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!

sql.datestamp and derby.

843859Jul 22 2006 — edited Jul 23 2006
Hi there. I'm trying to insert a date stamp into a derby db. I create a variable of type Timestamp and set it up with the current system time. This works fine because I tested the it in a dummy class.
Timestamp ts = new Timestamp(System.currentTimeMillis());
However when I insert the timestamp into the db with this code:
stmtSaveNewRecord.setTimestamp(3, ts);
The data saved in the table is 1 Jan 1970. When I saved it the data in the table as date data type it worked but Timestamp and Time are giving hassles and I need to save the time into the database.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 20 2006
Added on Jul 22 2006
1 comment
243 views