错误: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.
Exception in thread "main" java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
两处错误及解决方式:
一:别忘了你的驱动名称是com.mysql.cj.jdbc.Driver ,所以在c3p0的配置文件里要改下这个地方
二:数据库连接超时,那是因为你的连接数据库错误,记得在配置文件里改为jdbc:mysql://localhost:3306/stu?serverTimezone=GMT 这个样式,这样不管你mysql导入哪个版本的jar包都可以。
总结:要根据之前你的情况去写相应后面的