DatabaseMetaData Returns Wrong Data Type For Timestamp Column (Doc ID 1616553.1)

Last updated on AUGUST 03, 2016

Applies to:

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

Symptoms

There is a table T with the following column description.
SQL> desc T;
Name             Null?    Type
---------------- -------- --------------
C_TIMESTAMP_0             TIMESTAMP(0)
C_TIMESTAMP_1             TIMESTAMP(1)
C_TIMESTAMP_2             TIMESTAMP(2)
...
C_TIMESTAMP_9             TIMESTAMP(9)

Using rs.getString("DATA_TYPE")) with JDBC driver 11.2.0.3 returns wrong data type 1111 for all timestamp columns with fractional_seconds_precision 0..5, and 7..9. Only the fractional_seconds_precision 6 returns the correct data type 93.

 

Cause

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms