The save date includes time seconds, you want to use java.preparedState .SetTimeSTAMP ().
If the date is a string type first conversion to a date type, then transform into a TimeStamp type, save it.
Code:
Import java.sql. *;
...
CONNECTION CONN = ....
Connection conn = NULL;
String mydate = "2004-12-12 12:12:12";
Java.text.SIMPLEDATEFORMAT SDF = New Java.Text.SIMPLEDATEFORMAT ("YYYY-MM-DD HH: MM: SS");
PREPAREDSTATEMENT PS = Conn.PrepareStatement ("INSERT INTO TABLE TESTDATE VLAUES?");
Ps.setTimeStamp (SDF.PARSE (MyDate));
ps.execute ()
...