My Oracle Support Banner

Miillisecond Resolution Missing When Upgrading From JDBC To JDBC Driver (Doc ID 2331371.1)

Last updated on NOVEMBER 19, 2020

Applies to:

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


Miillisecond resolution is added for the Date object's getString() method on a ResultSet object when moving from JDBC to JDBC driver .
To enable TLS on the JDBC connections, the JDBC was upgraded to . After performing the upgrade, some of the timestamps have an additional zero in the "millisecond" field. An example of this issue is:

With JDBC driver:

$ java -cp .:<DIR>/ojdbc6- <PROGRAM NAME>
output as object =2017-09-23 22:14:25.0
output as string =2017-09-23 22:14:25

With JDBC driver:

$ java -cp .:<DIR>/ojdbc6- <PROGRAM NAME>
output as object =2017-09-23 22:14:25.0
output as string =2017-09-23 22:14:25.0

Notice that the additional ".0" .

It is expected to get the same results with JDBC and

The issue can be reproduced at will with the following steps:
1. Set CLASSPATH to point to JDBC
2. Create table:
create table <TABLE NAME>  (<COLUMN NAME1> number, <COLUMN NAME2> DATE default sysdate);
insert into <TABLE NAME> values (1, sysdate);
3. Run java program that calls getString() methoid
4. Do the same with JDBC




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

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