De standaard DATE-veldindeling van MySQL is:JJJJ-MM-DD
Terwijl in Java de standaardindeling van de klasse Datum (beschikbaar in java.util-pakket) is, dow mon dd hh:mm:ss zzz yyyy
dus gebruik dit:
Date date = txtToday.getText();
String pattern = "yyyy-MM-dd";
SimpleDateFormat formatter = new SimpleDateFormat(pattern);
String mysqlDateString = formatter.format(date);
System.out.println("Java's Default Date Format: " + date);
System.out.println("Mysql's Default Date Format: " + mysqlDateString);