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

·  阅读 334

遇到如下问题:

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驱动,修改就好。

分类:
后端
标签:
收藏成功!
已添加到「」, 点击更改