I was trying to execute SELECT statement by connecting from Java to Oracle DB. One of the table has column with Timestamp datatype .when i ran the jUnit test i got the below exception
java.lang.ClassCastException: oracle.sql.TIMESTAMP cannot be cast to java.sql.Timestamp
at com.sun.rowset.CachedRowSetImpl.getTimestamp(Unknown Source)
at org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet.getTimestamp(ResultSetWrappingSqlRowSet.java:491)
at com.wellpoint.provider.rnr.biz.integration.dao.PropsDAO.buildPropsResponse(PropsDAO.java:1476)
at com.wellpoint.provider.rnr.biz.integration.dao.PropsDAO.populatProps(PropsDAO.java:1320)
at com.wellpoint.provider.rnr.biz.integration.dao.PropsDAO.getProps(PropsDAO.java:388)
at com.wellpoint.provider.rnr.biz.managers.PropsManager.getProps(PropsManager.java:95)
at com.wellpoint.provider.rnr.biz.managers.PropsTest.testGetProps(PropsTest.java:94)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
...... .....
set the -D oracle.jdbc.J2EE13Compliant=true for PropsTest.java in the argument VM tab, tried to execute and got the below
java.lang.NoClassDefFoundError: oracle/jdbc/J2EE13Compliant=true
Caused by: java.lang.ClassNotFoundException: oracle.jdbc.J2EE13Compliant=true
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Exception in thread "main"
am i missing adding any jars or have to follow some other approach to solve this?
Any of your help is appeciated!
Thanks!