解决JDBC连接mysql时server time zone问题及com.mysql.jdbc.Driver is deprecated
首先這里產生了兩個錯誤,一個是jdbc加載驅動問題,另一個是time zone即mysql服務驅動和JDBC驅動時區不同步。
Loading class 'com.mysql.jdbc.Driver'. This is deprecated. The new driver class is 'com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
java.sql.SQLException: The server time zone value '???ú±ê×??±??' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
問題解決
總結
以上是生活随笔為你收集整理的解决JDBC连接mysql时server time zone问题及com.mysql.jdbc.Driver is deprecated的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何删除微软账户下的历史头像,及恢复默认
- 下一篇: Mysql 8.0下载与安装详解,并修改