Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

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!

converting a string into mySQL date format

843836Feb 22 2005 — edited Feb 22 2005
I have a bit of code that collects data values from a bean and I want it to then insert this into a mySQL database. My string is in the format "23/12/1983", how can i put this into a date field in my database? The bit of code I have got so far looks like this...
String month = formHandler.month + "/";
String day = formHandler.day + "/";
String year = formHandler.year ;
 
StringBuffer sb = new StringBuffer();
sb.append(day);
sb.append(month);
sb.append(year);
 
String myDate = sb.toString();
myDate is the value that I want to go into the database
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 22 2005
Added on Feb 22 2005
4 comments
320 views