I have a String
String s = "01 NOVEMBER 2012";
Then I want parse it to sqlDate. And insert it into the database.
Is it possible to parse that string to sqlDate?!?!
Yup, sql date format is "yyyy-mm-dd"
I have a String
String s = "01 NOVEMBER 2012";
Then I want parse it to sqlDate. And insert it into the database.
Is it possible to parse that string to sqlDate?!?!
Yup, sql date format is "yyyy-mm-dd"
Use
SimpleDateFormat
to parse String date to java.util.Dateand then convert it to java.sql.Date using millis
Expanding on Jigar Joshi answer.
This code has been able to handle whatever I've needed.