Re: com.mysql.jdbc.UpdatableResultSet.updateBlob gives AbstractMethodError



pjvleeuwen@xxxxxxxxx wrote:
David
Thrown when an application tries to call an abstract method. Normally,
this error is caught by the compiler; this error can only occur at run

version when running it. Check your compile-time and run-time
classpaths to ensure that they both reference the newer version of the
JAR file.
Thanks, but I only *have* one version. I guess the MySQL Connection\J
guys felt that the next "*Normally* this error..." was optional. :)

I suspect that I wasn't thinking clearly last night. Sorry. Here's a more likely explanation.

Your code never refers directly to the concrete implementation classes in the Connector/J JAR file (such as com.mysql.jdbc.Driver) but only to the classes (actually, mostly interfaces, like java.sql.Driver) in java.sql.* and javax.sql.*

Therefore, your compiler will have no reason to check any of the classes in the Connector/J JAR file, and the abstract method problem is not detected at compile time. Remember that java.sql.ResultSet, like java.sql.Driver, is an interface, not a class.

You only hit the abstract method problem when you actually run your code, and the Java virtual machine needs to load the concrete classes such as com.mysql.jdbc.Driver, which implements the java.sql.Driver interface.

When your program reaches the call to ResultSet.updateBlob at line 52, the JVM attempts to call the method updateBlob on a concrete com.mysql.jdbc.UpdatableResultSet object. That method is apparently abstract, and you get the mysterious AbstractMethodError.

I hope this makes better sense :-)

David Harper
Cambridge, England
.



Relevant Pages

  • Re: MFC and c++ problems
    ... compiler to generate code that is architecturally nonsensical. ... So a design in which a control has any syntactic knowledge of any container of itself ... GetParent->SendMessage is the interface of choice, ...
    (microsoft.public.vc.mfc)
  • Re: Win32 API and gfortran
    ... write out a module containing only interface blocks and compile the ... that the /iface switches and ATTRIBUTES directives change the compiler ... arguments are passed in the normal Fortran way ...
    (comp.lang.fortran)
  • Re: Using early-bound interface on a late-bound object
    ... > the compiler determines which interfaces to use, ... > supports the declared interface. ... >> help if someone can point me to some authoritative document or reference ... within customer shops when they mirrored this 'division' to keep their ...
    (microsoft.public.vb.general.discussion)
  • Re: object system...
    ... in a statically compiled app, all of the type information is known at ... compiler starts integrating itself with the outside world, ... produces the result, the type or interface. ... optimizations the ...
    (comp.object)
  • Re: Some OO design principles WAS Re: Differences in data description in programming languages
    ... Late binding means it is resolved at run time. ... Conformance is a quality that applies to interfaces. ... * An interface can also be a collection of method prototypes, ... the Compiler provides conformance checking. ...
    (comp.lang.cobol)