Monday, November 7, 2016

java - JDBC connection error : unrecognized timezone

java.sql.SQLException: The server time zone value is unrecognized or represents more than one time zone

Have to add "serverTimezone" parameter to connect url.

jdbc:mysql://localhost/db?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC

Apparently, to get version 5.1.33 of MySQL JDBC driver to work with UTC time zone, one has to specify the serverTimezone explicitly in the connection string

No comments:

Post a Comment