Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

case Types.DATE Error - urgent

 
ravindra kunapuli
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing a simple java program which connects to table in oracle.That table has a date type column. When i get the result i am creating an object for each column type using the switch case as follows:
switch (rsmd.getColumnType (i))
{
case Types.DATE:
case Typee.VARCHAR:
default.
}
The problem is with date type column. the case statement (Types.DATE) is not true for date type columns. so it not going to the case and rather going to the default.
I was debugging it, and i have seen that the rsmd.getColumnType (i) will return a integer value of 93. But the case Types.DATE has (returns) a value of 91. So, it is not going to case Types.DATE. Did any one try this. I have a lot of pieces of code on net, and everyone is using the same case statement for date type columns. Can anyone help me in this urgently.
Thanks.
Ravi.
 
Dana Hanna
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have the source code for java.sql.Types handy, but I'd bet that 93 is Types.TIMESTAMP. Take a look at the source for this file, or write a quick program printing out Types.TIMESTAMP.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic