Some background:
I have a Java 1.6 webapp running on Tomcat 7. The database is MySQL 5.5. Previously, I was using Mysql JDBC driver 5.1.23 to connect to the DB. Ever
Agree with @bluecollarcoder answer, but it's better to use TimeZone.getDefault().getID();
at the end of the connection string:
"jdbc:mysql://localhost/db?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=" + TimeZone.getDefault().getID();
In this case Timezone
parameter automatically updates depending on the local machine timezone.