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!

Convert Timestamp to java.util.date

843854Apr 19 2005 — edited Apr 19 2005
I'm storing a java.util.Date in a Timestamp field in Oracle since the java.sql.Date drops the time data. I succesfully covert from java.sql.Date to Timestamp with:

new Timestamp(trans.getTransDate().getTime());

but when I get the Timestamp back from Oracle I can't figure out how to get it back to a java.util.Date. I see in the API under Timestamp that there's a toString method that returns the date in JDBC timestamp escape format. What I can't figure out is how to convert that to a java.util.Date.

Can someone help me?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 17 2005
Added on Apr 19 2005
3 comments
369 views