解决JDBC连接mysql时server time zone问题及com.mysql.jdbc.Driver is deprecated
首先這里產(chǎn)生了兩個(gè)錯(cuò)誤,一個(gè)是jdbc加載驅(qū)動(dòng)問(wèn)題,另一個(gè)是time zone即mysql服務(wù)驅(qū)動(dòng)和JDBC驅(qū)動(dòng)時(shí)區(qū)不同步。
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.
問(wèn)題解決
總結(jié)
以上是生活随笔為你收集整理的解决JDBC连接mysql时server time zone问题及com.mysql.jdbc.Driver is deprecated的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 如何删除微软账户下的历史头像,及恢复默认
- 下一篇: Java中字符串以小数点分割时无效,St