Post test and memo memo so as not to forget ...
eclipse 2018 MySQL 5.6
When I try to display the value in SQL with java, It throws the following error.
Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value ' (W)' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
About a year after touching the program ... I still can't read the error, but ... I wondered what Timezone was, so I decided to look it up ...
Discovered while investigating! !! [Link] https://qiita.com/KKZ@github/items/e3f594b04c9233a86419 I arrived at this person's article.
At the bottom of the article
jdbc:mysql://localhost:xxxx/xxxx ?useUnicode=true& useJDBCCompliantTimezoneShift=true& useLegacyDatetimeCode=false& serverTimezone=UTC I wrote in the URL, and the error disappeared.
useUnicode=true Do you use Unicode? YES !! (I feel absolutely different ...)
useJDBCCompliantTimezoneShift=true When converting timezone information for TIME / TIMESTAMP / DATETIME values, Does the driver use JDBC-aware rules? YES
useLegacyDatetimeCode=false
In MySQL Connector / J 5.1.6, the processing around the time has been rewritten, and by setting useLegacyDatetimeCode = false, time zone conversion etc. are automatically handled.
That's right Do you do time zone conversion or yourself? NO! !! → Will do it automatically
By the way, In MySQL Connector / J 6, including the useLegacyDatetimeCode property All properties around the old timezone are deleted.
Was written in the link below. Lol [Link] https://vividcode.hatenablog.com/entry/mysql/connector-j-5.1-use-legacy-datetime-code
serverTimezone=UTC The server time zone is UTC!
It feels like I said ...
** @ KKZ-san ... Thank you! !! ** **
Ah, I'm going to get angry if someone in the company sees me ... crying ...