Pay attention to the difference between java.sql.Date () and java.util.Date ().
Util。 Date () includes date and time; Sql。 Date () only contains the date, not the time, so you need sql. Time () class, if you need time.
Of course, if sql. Date () and sql. Time () is used to insert time into the database, which is obviously troublesome. Sun company provides a good combination class java.sql.Timestamp (), which makes it much more convenient to insert time into the database.