0

I have the following error using the MySQL ResultSetImpl: In the project I am taking part of we have the problem, that a ResultSet is being closed before it is used, therefore throwing an exception.
To analyze this error I wanted to put a Thread.dumpStack() in the ResultSet.close() method so I can identify, where the erroneous call is coming from.
To be able to modify the code, I downloaded the MySQL Package from this position and extracted it: http://dev.mysql.com/downloads/connector/j/
I selected "platform independent" packacke for download.
Afterwards I copied the "com" and "org" packages into my project src folder and removed the mysql-jdbc.jar from the lib folder, subsequently removing the jar from the java build path in eclipse project settings.
After project clean and rebuild I got several hundred of compile errors like

Exception SQLException is not compatible with throws clause in Driver.getParentLogger() or 


The type FabricMySQLConnectionProxy must implement the inherited abstract method Connection.createSQLXML()`" or

 The type CallableStatement must implement the inherited abstract method CallableStatement.getNString(int)`".  

Now I am thinking that the MySQL guys should be able to package a compilable jar file, so I am thankful of anything I overlooked and any input on what I should have done differently to make this thing work.

2
  • it would maybe be easier to continue using your binary jar, attaching the source code you downloaded to it (find the jar in dependencies, right click attach sources). Then you will be able to set a breakpoint Commented Feb 27, 2015 at 11:10
  • Hi, yes, that is one way, but a bit impractical, as there would be MANY calls to this method until the error arises. I'd rather search a log instead of endlessly pressing "F8" in eclipse ;) But thanks for the idea anyway! Commented Feb 27, 2015 at 11:14

1 Answer 1

1

Missing interface methods because of your higher JDK version.
You are using a jdk 1.6(or above) (e.g. createSQLXML is member of Connection since 1.6).
The source code you have downloaded implements the Java 5 (or fewer) version of the Connection(and ResultSet,...) interface.
If you are using a Java 5 compiled jar in your app running with Java 6 or higher, that is no problem. But if you want to compile the sources with a higher Jdk, you have to implement the new interface methods which have been added since 1.5.
You can create the missing methods with one click per class by choosing eclipses add unimplemented method suggestion.
You do not need to write contents for the new methods, because they are unused.

Sign up to request clarification or add additional context in comments.

1 Comment

Wow, that explains a lot and was extremely helpful! Will try that, thanks a lot! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.