Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

connection.getMetaData().getColumns(...) and Timestamp

Ariel Morelli Andres-OracleMar 30 2010 — edited Oct 15 2014
Hi,
I'm developing a program that requires to read the column type of some tables.
This is my sample code:
ResultSet r = connection.getMetaData().getColumns(null, "USER", "TABLE", "TS_COL");
while (r.next()) {
	int n = r.getMetaData().getColumnCount();
	for (int i=1;i<=n;i++) {
		System.out.print(r.getMetaData().getColumnName(i));
		System.out.print("=");
		System.out.println(r.getString(i));
	}
}
If I run that code using DataDirect driver, I get the following response:

TABLE_SCHEM=USER
TABLE_NAME=TABLE
COLUMN_NAME=TS_COL
DATA_TYPE=93
TYPE_NAME=TIMESTAMP
COLUMN_SIZE =11
....

But, if I run the same code with oracle thin jdbc driver, I get the following result:
TABLE_SCHEM=USER
TABLE_NAME=TABLE
COLUMN_NAME=TS_COL
DATA_TYPE=93
TYPE_NAME=TIMESTAMP(6)
COLUMN_SIZE =11
DECIMAL_DIGITS=6
....


I want to know if the "*(6)*" belongs to the data type or if it is just a bug.

I really appreciate your help,
Ariel A.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 4 2010
Added on Mar 30 2010
6 comments
2,912 views