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.Date
java.util.Date utilDate = new SimpleDateFormat("dd MMM yyyy").parse("01 NOVEMBER 2012");
and then convert it to java.sql.Date using millis
java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());