Loading class `com.mysql.jdbc.Driver‘. This is deprecated. The new driver class is `com.mysql.cj.jdb

遇到如下问题:

Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.mysql.cj.jdbc.Driver’. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.

mysql-connector-java包版本问题:

5.x版本的驱动文件jar包对应的是:Class.forName(“com.mysql.jdbc.Driver”);语句来加载数据库驱动

8.0x版本的驱动文件jar包对应的是Class.forName(“com.mysql.cj.jdbc.Driver”);

查看你所使用的jdbc驱动,修改就好。

posted @ 2020-12-02 16:45  乖怪丶  阅读(191)  评论(0编辑  收藏  举报
……