Tuesday, January 19, 2021

Oracle Timestamp Issue

When querying Oracle Timestamp to JAVA Timestamp following error can be occurred. 

java.lang.ClassCastException: oracle.sql.TIMESTAMP cannot be cast to java.sql.Timestamp

This error can resolve using following two options.

1. Add JVM startup parameters. -Doracle.jdbc.J2EE13Compliant=true in the application

2. Add system properties in the application. System.getProperties().setProperty("oracle.jdbc.J2EE13Compliant", "true")

Reference site

https://docs.oracle.com/cd/B28359_01/java.111/b31224/datacc.htm


No comments:

Post a Comment