錯誤:Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.c

這是由於mysql驅動包跟新的緣故,不能再使用以前舊的mysql驅動包。

根據提示,更改相應的驅動包就可以了。

這個驅動更新還可能會引發一個錯誤:

java.sql.SQLNonTransientConnectionException: Cannot load connection class because of underlying exception: com.mysql.cj.exceptions.WrongArgumentException: Malformed database URL, failed to parse the connection string near ';characterEncoding=utf-8'

解決辦法:

之前:jdbc:mysql://localhost:3306/tree?useUnicode=true&characterEncoding=utf-8

現在:jdbc:mysql://localhost:3306/tree?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone = GMT

將之前的鏈接改成現在的鏈接後,就不會出現這個問題。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章