Insert & fetch java.time.LocalDate objects to/from an SQL database such as H2
问题 How to insert and fetch java.time types such as LocalDate via JDBC to an SQL database such as the H2 Database Engine? The old way using PreparedStatement::setDate and ResultSet::getDate works for the legacy java.sql.Date type. I want to avoid using these troublesome old date-time classes. What is the modern way for sending java.time types through a JDBC driver? 回答1: We have two routes to exchanging java.time objects through JDBC: JDBC 4.2 compliant drivers If your JDBC driver complies with