try {
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
Date dob = null;
dob = sdf.parse(txtToday.getText());
java.sql.Date sqlDate = new java.sql.Date(dob.getTime());
c1.setDOB(sqlDate); //use this sqlDate for inserting into Database
} catch (ParseException e) {
System.out.println("Parse exception,incorrect input in the textbox");
e.printStackTrace();
}