Allowed conversions of java.time Objects
Lance Andersen - Oracle
Lance.Andersen at oracle.com
Wed Feb 12 13:53:05 PST 2014
On Feb 12, 2014, at 4:28 PM, Mark Rotteveel wrote:
> I am currently implementing some of the new java.time conversions for JDBC 4.2 and I am wondering if there might be some conversions missing from the changelog.
>
> According to the changelog (https://jcp.org/aboutJava/communityprocess/maintenance/jsr221/JDBC4.2MR-Oct232013.pdf) the Table B-5 mapping for java.time.LocalDate is:
> CHAR, VARCHAR, LONGVARCHAR and DATE
>
> In this list I'd also expect TIMESTAMP (as a similar mapping does exist for java.sql.Date).
>
> Similarly the mapping for LocalTime also misses TIMESTAMP (as does exist for java.sql.Time).
We had talked about this earlier and there really is no way to convert these given the specific properties of the objects (i.e. no time or date)
>
> Is this intentional, or an omission? If the former: what is the rationale?
Intentional
>
> Similarly: shouldn't a conversion from OffsetTime and OffsetDateTime to TIME respectively TIMESTAMP be allowed as well?
TIMESTAMP and TIME do not represent any Timezone
>
> PS Also note that the changelog talks about javax.time, while the JSR 310 classes are in java.time
Yep this is fixed, that was left over from early drafts and before package names changed.
Best
Lance
> --
> Mark Rotteveel
-------------- next part --------------
Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering
1 Network Drive
Burlington, MA 01803
Lance.Andersen at oracle.com
More information about the jdbc-spec-discuss
mailing list