MySQL JDBC Driver 5.1.33 - Time Zone Issue

前端 未结 30 1842
栀梦
栀梦 2020-11-22 05:22

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

30条回答
  •  深忆病人
    2020-11-22 05:47

    Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/resultout? useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC","root",""))
    

    This is actually the solution to this problem, but don't just copy and paste it in your program. If you just read the line you will find 'resultout', that's the name of my database, and you have to write your's.

    There are three string components, first one is url, second is username, and third one is password. In above paragraph we cleared, url. The second and third String components as said your username and password you have to change accordingly.

    Thanks

提交回复
热议问题