JDBCThe new driver class is `com.mysql.cj.jdbc.Driver‘. The driver is automatically
Posted 我是一棵卷心菜
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JDBCThe new driver class is `com.mysql.cj.jdbc.Driver‘. The driver is automatically相关的知识,希望对你有一定的参考价值。
前言
今天在使用JDBC连接mysql数据库时,在控制台报错:
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.
1、问题原图:
问题来了,这一大堆英语,是什么意思呢?我给大家翻译一下:
加载类'com.mysql.jdbc.Driver'
这是弃用的类
新的驱动类是' com.mysql.cj.jdbc.Driver '
驱动程序是通过SPI自动注册的,手动加载驱动类通常是不必要的
2、解决办法
只需要将com.mysql.jdbc.Driver
驱动类改为com.mysql.cj.jdbc.Driver
就可以解决问题了,是不是很简单呢。
以上是关于JDBCThe new driver class is `com.mysql.cj.jdbc.Driver‘. The driver is automatically的主要内容,如果未能解决你的问题,请参考以下文章
解决:Loading class `com.mysql.jdbc.Driver‘. This is deprecated. The new driver class is `com.mysql.cj
解决:Loading class `com.mysql.jdbc.Driver‘. This is deprecated. The new driver class is `com.mysql.cj
解决:Loading class `com.mysql.jdbc.Driver‘. This is deprecated. The new driver class is `com.mysql.cj(
解决:Loading class `com.mysql.jdbc.Driver‘. This is deprecated. The new driver class is `com.mysql.cj
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj
Loading class `com.mysql.jdbc.Driver‘. This is deprecated. The new driver class is `com.mysql.cj.jdb