Use Java 8 date/time types instead of java.sql where possible in JDBC driver interactions

Description

Judging from the tests of the MariaDB Connerctor/J JDBC driver, there is at least partial support for the java.time date/time types in JDBC drivers. From what I've read elsewhere, this might even be a standard feature.

See https://github.com/MariaDB/mariadb-connector-j/blob/13c8721a306fe8f1a6a67c9282ce04c00c269892/src/test/java/org/mariadb/jdbc/LocalTimeTest.java

We're getting a huge amount of bugs related to the quirks of java.sql date/time types. Maybe we should investigate switching to java.time types where possible?

At the very least, we could pass LocalDate, LocalTime, ZonedDateTime, etc to the JDBC driver directly, instead of trying (with a lot of pain) to convert them to java.sql types.

This would probably require the introduction of a feature flag, because I'm sure behavior would be different in some cases, be it only when the new strategy fixes existing bugs...

Environment

None

Assignee

Unassigned

Reporter

Yoann Rodière

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure