| Bug #83121 | PreparedStatement.setObject should accept java.time.OffsetTime/OffsetDateTime | ||
|---|---|---|---|
| Submitted: | 23 Sep 2016 5:45 | Modified: | 23 Sep 2016 18:36 |
| Reporter: | Jules H | Email Updates: | |
| Status: | Won't fix | Impact on me: | |
| Category: | Connector / J | Severity: | S3 (Non-critical) |
| Version: | 6.0 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
[23 Sep 2016 5:45]
Jules H
[23 Sep 2016 8:45]
Jules H
As an extension, it would be nice to support java.time.Instant also (probably by converting it to an OffsetDateTime with a UTC time zone).
[23 Sep 2016 18:36]
Filipe Silva
Hi Jules, Thank you for taking the time to write this report. At the time being we cannot support the *_WITH_TIMEZONE types in Connector/J as there is no way of storing the time zone information for temporal data types in MySQL server. Although we could implement some kind of workaround and convert these object to some other type we support, the fact is that we would be loosing information we couldn't guarantee the correct data between storing and retrieving operations. So, whatever it is in our power to do, it is better done in the client application where you have full control of the kind of data you send and expect and any transformations you wish to apply. Actually we do have some kind of support for this (and any other Serializable object). You can use the method PreparedStatment#setObject(int, Object) with these objects as long as the table column accepts raw binary data, such as any of the BLOB variants. Obviously you won't be able to use this data in you queries but for some cases it may work.
