1. When working with the Oracle database using JDBC, the date type of the database that corresponds to the java.sql.Date type is used, which can be saved and read only at this time.
Time (hours, minutes, seconds) can not be read and saved;
The query result set can get data of the Date type directly: Java.sql.Date date=resultset.getdate ("DateTime");
Data of the Java.sql.Date type can also be saved directly to the database or directly compared to the date type data in the database;
The date of the string, the conversion function to_date (' 2017-4-8 ', ' yyyy-mm-dd ') of the SQL statement to the date type is inserted into the database.
2. When using hibernate to operate an Oracle database, the Java.util.Date type corresponds to the date type of the database, at which time the database can be saved and read to seconds and minutes;
Data of the java.sql.Date and java.util.Date types can be saved directly to the database or directly compared to the date type data in the database, but the number
The date data that is read by the library is saved with Java.util.Date because Java.sql.Date is a subclass of Java.util.Date.
When the Oracle database saves dates in date type, which class in Java corresponds to the date type of the database?