I'm trying to store a java.util.Date
value that contains a date and time together in a MySQL record. I've tried this:
java.util.Date d = new java.util.Date();
plantilla = new SimpleDateFormat("dd/MM/yyyy H:mm");
String tiempo = plantilla.format(d);
And then write to MySQL the value tiempo
but it does not work. I do not know if I have to use the class java.sql.Date
. In any case I'm lost.
Can I directly burn a java.util.Date
value in MySQL by defining the field with another type than DATETIME
or not recommended?