my dog learned polymorphism*
The moose likes JDBC and the fly likes Convert Datetype from Access database to Java 'DATETIME' Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Convert Datetype from Access database to Java Watch "Convert Datetype from Access database to Java New topic

Convert Datetype from Access database to Java 'DATETIME'

Tracy Lee

Joined: May 08, 2001
Posts: 5
When I tried to convert the data in a MS Access Database, which I create in Access 2000, all number and string worked fine. But there is a table containning a date type --- 'Date/time' with short date form e.g. today 01-05-08(yy-mm-dd). when compiling it, shows DATATIME type. Java.sql.resultSet has got no method to convert it ( relevant are getDate, getTime, getTimeStamp).
Could anybody Help. I would appropriate it.

Ganapathi Srinivasan
Ranch Hand

Joined: Apr 18, 2001
Posts: 41
If you are using JDBC ODBC bridge driver, then getDate function will work properly. It is just that it shall return a java.sql.Date object without any time info. If you do not need the time info, you can use the getDate method itself. I do not foresee any problem for getDate method with Access DateTime value.
Hope I am clear.
I agree. Here's the link:
subject: Convert Datetype from Access database to Java 'DATETIME'
Similar Threads
Date format
About convert datetype 'DATETIME' From SQL (access 2000)into JAVA
Date Format
Date format
How can convert DATETIME type to JAVA date type?