My understanding is that the guidance for implementing in JDBC 4.2 the new Java 8 java.time classes, is to use the to/fromObject() methods of RecordSet and then cast explicitly. See for example on stackoverflow.
I would suggest the use of the following mappings:
| SQL type | java.time type |
|---|---|
| TIME | LocalTime |
| TIME WITH TIME ZONE | OffsetTime |
| TIMESTAMP | LocalDate |
| TIMESTAMP WITH TIME ZONE | OffsetDateTime |
On a separate note, you may want to re-consider the toString() representation of sql timestamps - currently HSQL uses a rather unique representation where the hour and offset-hour are not padded with zeros. I don't have access to the SQL spec but I suspect that this is not a format used by ISO or any RFC, so I would guess not by SQL either. The reason this is a little relevant here is because the Java8 formatters are unable to parse/print such timestamps (specifically the offset-hour without a leading zero). I found this out as I was looking at the implementation in the typesafe slick ORM, where they're currently using the toString() representation to add Java8 support in the short-term.
Sorry, should have been:
supported in version 2.4.0