JDBC 12c Adds Timestamp to java.sql.Date After Upgrading From 188.8.131.52
Last updated on MARCH 01, 2018
Applies to:JDBC - Version 184.108.40.206.0 to 220.127.116.11.0 [Release 12.1]
Information in this document applies to any platform.
The behavior of setDate() has changed starting with Oracle JDBC Driver 18.104.22.168.
As result, time is inserted into DATE column if using setDate() method.
From Oracle JDBC Driver 22.214.171.124 : the time is inserted as defined in the variables.
Oracle JDBC Driver 126.96.36.199 or earlier : the driver sets the time to "00:00:00".
Sample Code :
Date cd = new Date(System.currentTimeMillis());
Execute "select to_char(hiredate, 'DD-MON-YYYY HH24:MI:SS') from emp" statements,
the result is like follows.
- JDBC Driver 188.8.131.52 and earlier version : 12-NOV-2014 00:00:00
- JDBC Driver 184.108.40.206 and later : 12-NOV-2014 16:14:48
Sign In with your My Oracle Support account
Don't have a My Oracle Support account? Click to get started
Million Knowledge Articles and hundreds of Community platforms