My Oracle Support Banner

getDate() Gets Time After Upgrading To 12c (Doc ID 2177909.1)

Last updated on NOVEMBER 22, 2017

Applies to:

JDBC - Version 12.1.0.1.0 and later
Information in this document applies to any platform.

Symptoms

getDate() method gets time (hours/minutes/seconds) after upgrading JDBC Driver to 12.1.0.1 or later.

Sample code:

PreparedStatement stmt = con.prepareStatement("SELECT sysdate FROM dual");
Calendar cal;
ResultSet rs = stmt.executeQuery();
while(rs.next())
{
Date sysdate = rs.getDate(1);
StringBuffer buf = new StringBuffer();
buf.append("[ toString=").append(date.toString()).append(": getTime()=").append(date.getTime()).append(" ]");
System.out.println(buf.toString());

Results:

11.2.0.4 or before: [ toString=2016-08-31: getTime()=1472569200000 ]

12.1.0.1 or later : [ toString=2016-08-31: getTime()=1472629454000 ]  <- contains time information

 

Changes

Upgrade JDBC Drive to 12c.

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.