Skip to Main Content

Java and JavaScript in the Database

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!

Date Exception java.text.ParseException: Unparseable date:

275123Apr 6 2004 — edited Apr 6 2004
I am writing a web appliction which takes in a date in the format of 02/05/2004.
I need to format the date and then insert it into an Oracle DataBase which takes Dates in the format of 02/May/2004.


I am not sure of hwo to write the code but this is my effort:

String aDate = "02/04/2004";
String formattedDate = null;
DateFormat dateFormatter;
Locale lc = Locale.UK;

Date date = null;

dateFormatter = DateFormat.getDateInstance(DateFormat.DEFAULT,lc);
try
{
date = dateFormatter.parse(aDate);
System.out.println(date.toString());
}
catch(ParseException e)
{
System.out.println("Date Exception "+e);
}

It return an exception Date Exception java.text.ParseException: Unparseable date: "02/04/2004"

Is there a date conversion function in Oracle which would convert the date into one that is acceptable to Oracle.
Thank for any help.

Tony

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 4 2004
Added on Apr 6 2004
1 comment
533 views