Domanda

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

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top