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!

Problem with inserting date into the database through Java

843859Aug 19 2008 — edited Aug 21 2008
Hi all,
I have a small confusion when updating date into the ORACLE database through Java.
In database date is stored in 'mm-dd-yy' format.
My current date format is 'yyyy-mm-dd' [this is ISO Date format actually obtained from JSP].
I have to get this value from JSP through Java class and store them In DB.
Before that I have to convert to the format 'yyyy-mm-dd' to 'dd-mon-yy' inorder to store in the database, but I am unable to do that.

Current Syntax that i am using now
String updateQuery="update table <table_name> set archive_date= TO_CHAR('2007-12-02','dd-mm-yy')";
This is not working. Am i wrong anywhere.

Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 18 2008
Added on Aug 19 2008
7 comments
2,118 views