MySQL JDBC Driver 5.1.33 - Time Zone Issue

Solution 1:

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.

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

Solution 2:

I've solved this problem by configuring MySQL.

SET GLOBAL time_zone = '+3:00';