Bug #95036 | 8.0.15 JDBC Driver can not work in DST time zone | ||
---|---|---|---|
Submitted: | 16 Apr 2019 7:22 | Modified: | 29 May 2019 17:20 |
Reporter: | sxq sxq | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | Connector / J | Severity: | S1 (Critical) |
Version: | 8.0.15 | OS: | Linux |
Assigned to: | CPU Architecture: | Any | |
Tags: | jdbc, time zone |
[16 Apr 2019 7:22]
sxq sxq
[17 Apr 2019 1:40]
sxq sxq
when i add "&serverTimezone=UTC" or "&serverTimezone=CST6CDT" in the connect URL, i can connect to server, but when i use "&serverTimezone=CDT",the exception happen again.i guss the default value of serverTimezone between version 5.1.47 and version 8.0.15 are different, and the new value is not correct.
[21 May 2019 14:29]
Alexander Soklakov
Hi, This is not a bug. Exception message contains a hint, "'CDT' ... or represents more than one time zone". You could check, for example, https://www.timeanddate.com/time/zones/ and find: CDT - Central Daylight Time, North America, UTC -5 CDT - Cuba Daylight Time, Caribbean, UTC -4 CDT - Chatham Daylight Time The exception usually appears when c/J takes time zone name from operating system which could return one of such ambiguous abbreviations. To fix that you just need to pass the univocal time zone name. In case of Central Daylight Time it would be "&serverTimezone=America/Chicago".
[29 May 2019 17:20]
Filipe Silva
This is a duplicate of Bug#85816. Note that it works when you use "&serverTimezone=UTC" or "&serverTimezone=CST6CDT" because Java recognizes these as valid time zones. "&serverTimezone=CDT" fails because "CDT" is not a valid time zone in Java. So, this means that you can set whatever time zone values Java recognizes in the connection property "serverTimezone". The options available to you are described in TimeZone Javadoc (https://docs.oracle.com/javase/8/docs/api/index.html?java/util/TimeZone.html). Also mind that, although some are supported, using three-letter time zones is deprecated, as mentioned in the same page.