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
More Related Contents:
- How to change MySQL timezone in a database connection using Java?
- How to configure Tomcat to connect with MySQL
- SQL syntax error in "insert into 'keys'(a,b,c,d,e) values(?,?,?,?,?)" [closed]
- Hours and seconds are lost when storing a date in the database [closed]
- How to get UTF-8 working in Java webapps?
- Multiple queries executed in java in single statement
- Using “like” wildcard in prepared statement
- ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long on connect to MySQL
- MySQL and JDBC with rewriteBatchedStatements=true
- Closing JDBC Connections in Pool
- No suitable driver found for ‘jdbc:mysql://localhost:3306/mysql [duplicate]
- Error: Client does not support authentication protocol requested by server; consider upgrading MySQL client
- “Loading class com.mysql.jdbc.Driver … is deprecated” message
- Returning a ResultSet
- Java JDBC MySQL exception: “Operation not allowed after ResultSet closed”
- How I save and retrieve an image on my server in a java webapp [duplicate]
- java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/dbname [duplicate]
- Retrieve an Image stored as BLOB on a MYSQL DB
- Can I execute multiple queries separated by semicolon with MySQL Connector/J? [duplicate]
- Native Library sqljdbc_auth.dll already loaded in another classloader
- mysql prepared statement error: MySQLSyntaxErrorException
- how to get list of Databases “Schema” names of MySql using java JDBC
- SQL Error: 0, SQLState: 08S01 Communications link failure [duplicate]
- Access denied for user ‘root’@’localhost’
- How to correctly write UTF-8 strings into MySQL through JDBC interface
- Glassfish Admin Console throws java.lang.IllegalStateException when creating JDBC Pool
- java.sql.SQLException: Before start of result set [duplicate]
- How to use prepared statement for select query in Java?
- Stumped SQL Exception for JDBC
- How to connect to a remote MySQL database with Java?