Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JDBC incompatibility error

I have a legacy code written in older version of java. I am trying to compile the code and generate an .ear file using ant. The java version i am using is jdk7/jdk6 as java home . On executing the ant script, I am getting following error

Compiling 20 source files to C:\views\kroger\kroger\of_platform\build\oneforce\classes\ra
warning: [options] bootstrap class path not set in conjunction with -source 1.4
C:\views\kroger\kroger\of_platform\sdk\src\java\ra\com\workscape\connector\wedb\
JdbcConnectionImpl.java:81: error: JdbcConnectionImpl is not abstract and does not     override abstract method getNetworkTimeout() in Connection

public class JdbcConnectionImpl implements JdbcConnection {

C:\views\kroger\kroger\of_platform\sdk\src\java\ra\com\workscape\connector\wedb\
JdbcDataSource.java:78: error: JdbcDataSource is not abstract and does not override abstract method getParentLogger() in CommonDataSource

public class JdbcDataSource

I am assuming this error is because of certain jars not compatible with newer jdk version. This works good when I use jdk1.4/1.5 .. Pls let me know if i need to take any latest version of jar.. The database used is oracle and i am using ojdbc14 for compilation of the database java code.

Its kind of important as we have to decide which version of java we need to use.

Thanks

like image 275
Monish Das Avatar asked Apr 29 '14 18:04

Monish Das


1 Answers

Java 1.7 has introduced few new methods in CommonDataSource & Connection interfaces. The ones for which you are seeing the error are:

getParentLogger()

getNetworkTimeout()

Also, keep in mind that there are more new methods in Java 1.7 than the above two stated ones.

If you want to use Java 1.7, then your custom classes, JdbcConnectionImpl & JdbcDataSource (or their super classes) should implement the new methods defined by Connection & CommonDataSource, respectively.

like image 153
Mubin Avatar answered Nov 05 '22 19:11

Mubin