1、异常提示:
  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.

 

2、原因分析:
  从翻译可知是驱动 com.mysql.jdbc.Driver 已被废弃,不再建议使用了(并非不可使用),推荐使用新的 MySQL JDBC 驱动 com.mysql.cj.jdbc.Driver,新的驱动可借助 SPI 自动注册并不再需要手动加载驱动。
  需要说明的是这个不是错误,而是一个警告信息。

 

3、解决办法:
  我们将 MySQL 配置中的 com.mysql.jdbc.Driver 替换成 com.mysql.cj.jdbc.Driver 即可。

相关文章:

猜你喜欢
  • 2021-08-28
  • 2021-09-21
  • 2021-05-29
  • 2021-10-19
  • 2021-07-11
相关资源
相似解决方案