File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes case Types.DATE Error -  urgent Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "case Types.DATE Error -  urgent" Watch "case Types.DATE Error -  urgent" New topic
Author

case Types.DATE Error - urgent

ravindra kunapuli
Greenhorn

Joined: Oct 29, 2003
Posts: 2
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

Joined: Feb 28, 2003
Posts: 227
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: case Types.DATE Error - urgent
 
Similar Threads
removeRow() in AbstractTableModel
JTable date edit problem
auto insert in jdbc
Oracle date format issue
Null Value in JTable