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!

HSQLdb with date as well as time

843859Jul 28 2007 — edited Aug 8 2007
Hi i have just started using HSQLDB,

And trying to port some of my old code into it, and one of the problems i have run into is trying to store dates, with there times as well,

like somthing happened on the 23/04/2007. at 14:23:23 seconds,

but i cant seem to find the data type to store the collumn as DATE, DATETIME, TIMESTAMP, didnt seem to work.

then the code for inserting the time? this is what i used before.
   "INSERT INTO record(date) "+
                    "values (?)");
            java.sql.Date d= new java.sql.Date (System.currentTimeMillis ());
            preparedStatement.setDate (1,d);
but that didnt seem to work with any of the field types, is there somthing i am doing wrong? it just keeps cutting the "time" off, and i really want that time.

Thanks any feed back would be great
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 5 2007
Added on Jul 28 2007
3 comments
404 views