解决Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.j...
解决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.警告问题
错误提示:
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.
解决方式:
报错意思就是说com.mysql.jdbc.Driver这个驱动已经被弃用了,新的驱动为com.mysql.cj.jdbc.Driver,通常是自动注入的。
所以,我们只需要按照提示,将“com.mysql.jdbc.Driver”驱动改为“com.mysql.cj.jdbc.Driver”。
<property name="driver" value="com.mysql.cj.jdbc.Driver"/>
x