How to convert java.util.date into java.sql.date?
Transformation:
Java.sql.date sd;
Java.util.date UD;
// Initialize The Ud Such as ud = new java.util.date ();
SD = new java.sql.date (ud.gettime ());
If you want to insert into the database and the corresponding field is a Date type
Then you can use PreparedStatement.SetDate (int, java.sql.date)
Where java.sql.date can be obtained with the above method
You can also provide to_date functions with a database.
For example, existing UD
To_date (New SimpleDateFormat (). Format (UD, "YYYY-MM-DD HH: MM: SS"),
"YYYY-MM-DD HH24: MI: SS")
Note that the formats provided by the format and databases in Java are different.