[Untitled] The difference between database driver 5 and above

An Error/Exception about the database encountered by JAVA Spring-mvc:

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.

reason:

The com.mysql.jdbc.Driver driver is in mysql-connector-java 5

The com.mysql.cj.jdbc.Driver driver is mysql-connector-java 6 or later

When the above error occurs, you can set the .properties file: driverClassName = com.mysql.cj.jdbc.Driver

おすすめ

転載: blog.csdn.net/weixin_51961968/article/details/124702609