博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
更换mysql-connector-java-6.0.5jar包后程序出现的两个异常及解决方法
阅读量:4148 次
发布时间:2019-05-25

本文共 795 字,大约阅读时间需要 2 分钟。

异常一: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.

异常二:java.sql.SQLException: The server time zone value '?й???????' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

 解决方法:

第一个异常是因为mysql-connection-java的最新版本不建议使用“com.mysql.jdbc” 包下面的“Driver”,改正方法直接把配置文件中的“com.mysql.jdbc.Driver”改为在异常中提示的“com.mysql.cj.jdbc.Driver”。

 

第二个异常显示新版本的数据库连接程序需要指定UTC时区,改正方法将配置文件中的“url”后面加上指定的时区,将其值改为“url=jdbc:mysql://localhost:3306/。。。&serverTimezone=GMT”

转载地址:http://sytti.baihongyu.com/

你可能感兴趣的文章
X-code7 beta error: warning: Is a directory
查看>>
Error: An App ID with identifier "*****" is not avaliable. Please enter a different string.
查看>>
3.5 YOLO9000: Better,Faster,Stronger(YOLO9000:更好,更快,更强)
查看>>
iOS菜鸟学习--如何避免两个按钮同时响应
查看>>
iOS菜鸟学习—— NSSortDescriptor的使用
查看>>
CORBA links
查看>>
如何使用BBC英语学习频道
查看>>
初识xsd
查看>>
java 设计模式-职责型模式
查看>>
构造型模式
查看>>
svn out of date 无法更新到最新版本
查看>>
java杂记
查看>>
RunTime.getRuntime().exec()
查看>>
Oracle 分组排序函数
查看>>
删除weblogic 域
查看>>
VMware Workstation 14中文破解版下载(附密钥)(笔记)
查看>>
日志框架学习
查看>>
日志框架学习2
查看>>
SVN-无法查看log,提示Want to go offline,时间显示1970问题,error主要是 url中 有一层的中文进行了2次encode
查看>>
NGINX
查看>>