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.
翻译:
新的驱动程序类是“com.mysql.cj.jdbc.driver”。驱动程序是通过SPI自动注册的,通常不需要手动加载驱动程序类。
就是说JDBC驱动程序在注册驱动时
1、注册驱动
DriverManager.registerDriver((new com.mysql.jdbc.Driver()));
需要改为
DriverManager.registerDriver((new com.mysql.cj.jdbc.Driver()));
即可。