6报错Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class is
com.mysql.cj.jdb
用了最新的Mysql的依赖而出现的:驱动程序通过SPI自动注册,而手动加载类通常是不必要的,解决方案如下:
7报错jdbc与数据库链接:发现程序一启动就会出现CommunicationsException: Communications link failure 检查你的数据库连接地址(配置文件中的url)是否正确. 8报错java.sql.SQLException: The server time zone value ‘Öйú±ê׼ʱ¼ä’ is unrecognized or represents more than one time zone. You must configure 是时区的错误,因此只你需要设置为你当前系统时区即可,解决方案如下: 解决方案
//解决方案
static final String DB_URL="jdbc:mysql://localhost:3306/csm"+"?serverTimezone=GMT%2B8";
//加上?serverTimezone=GMT%2B8" 即可 GMT%2B8代表: 东八区
//GMT%2B8代表: 东八区
最后test测试成功