I am facing a strange kind of scenario. I have the following table, with two columns.
Customer:
Customer_ID nvarchar2
Subscription_Date Date
I am trying to get the column type of Subscription_Date using Meta Data as shown below:
ResultSet rs = selectStmt.executeQuery("SELECT Customer_ID, Subscription_Date FROM Cusomter");
java.sql.ResultSetMetaData rsMetaData = rs.getMetaData();
int type1 = rsMetaData.getColumnType(2);
If I use JDK 1.6 and ojdbc6.jar, type1
is returned as
93 (java.sql.Types.TIMESTAMP)
If I use JDK 1.5 and ojdbc14.jar, type1
is returned as
91 (java.sql.Types.DATE)
But in both the scenarios, the actual column type of Subscription_Date is DATE
.
Is this some backward compatability issue? Or is my way of coding is wrong?
Can you guys please look into it and provide some suggestion?