今天因为servlet原因重新搭建了一遍tomcat 环境,eclipse 也重装了,servlet 能用了但是运行时有很多警告?

Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.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这个,因为你重新搭建环境之后可能版本比较新的原因,很多东西都废除不再使用了,之前用的旧版本可能不报错

警告可以不用管,只要不报错,能运行就行。

提示的很明显了。 把配置里面mysql驱动改成 com.mysql.cj.jdbc.Driver