高版本mysql-connector-java,指的是6.0往后容易出现的一些警告:
1.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.cj.jdbc.Driver 以前的正式放弃的时候了
2.如下的一个警告
警告: com.mchange.v2.async.ThreadPoolAsynchronousRunnerxxxxxxx -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!
解决方案:连接地址添加一个serverTimezone=UTC(serverTimezone=America/New_York)即可
3.You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification
You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification
解决方案:连接地址添加一个useSSL=false即可,在高版本需要指明是否进行SSL连接
3.1添加过程中出现的问题
对实体 "characterEncoding" 的引用必须以 ';' 分隔符结尾
http://www.zhimengzhe.com/shujuku/MySQL/83725.html
http://blog.youkuaiyun.com/jinguangliu/article/details/53691609
<property name="url" value="jdbc:mysql://localhost:3306/jikebook?useSSL=true&verifyServerCertificate=false&serverTimezone=UTC" />
4.Exceptionin thread "main" java.lang.UnsupportedClassVersionError:com/mysql/jdbc/Driver : Unsupport
Exceptionin thread "main" java.lang.UnsupportedClassVersionError:com/mysql/jdbc/Driver : Unsupport
解决方案:jdk版本较低,而驱动包的版本较高造成的,要求是jdk1.8以上