Loading class `com.mysql.jdbc.Driver'. This is deprecated警告处理,jdbc更新处
1.报错信息是这样的;
处理:处理办法,按照提示更该jdbc.properties配置 .
com.mysql.jdbc.Driver 改为 com.mysql.cj.jdbc.Driver
运行结果如下:PS 已经没有这一条报错或者警示了,一条一条处理报错。
2.报错信息
Fri Sep 07 17:48:01 GMT+08:00 2018 WARN: Establishing SSL connection without server's identity verification
处理:时间报错,是因为新版的mysql会询问是否SSL连接,返回一个Boolean值,我们需要手动指定true或者false。
配置URL,如下:
<property name="url" value="jdbc:mysql://localhost:3306/mybatis?characterEncoding=utf-8&serverTimezone=UTC&useSSL=false"/>
如果是配置了jdbc.properties的话,使用下面配置:
在时间后面添加&连接useSSL=false 即可。
jdbc.DriverClassName=com.mysql.cj.jdbc.Driver
jdbc.url =jdbc:mysql://localhost:3306/student?serverTimezone=UTC&useSSL=false
jdbc.username=root
jdbc.password=root
<environments default="development">
<environment id="development">
<!-- 使用jdbc事务管理,事务控制由mybatis-->
<transactionManager type="JDBC" />
<!-- 数据库连接池,由mybatis管理-->
<dataSource type="POOLED">
<property name="driver" value="${jdbc.DriverClassName}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
</dataSource>
</environment>
</environments>
运行结果如下:
(3)警告处理
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.ibatis.reflection.Reflector (file:/G:/Develop/20180907am/lib/mybatis-3.4.6.jar) to method java.lang.Class.checkPackageAccess(java.lang.SecurityManager,java.lang.ClassLoader,boolean)
WARNING: Please consider reporting this to the maintainers of org.apache.ibatis.reflection.Reflector
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
译文如下:
警告:发生了非法的反射访问操作
警告:通过org.apache. ibatis.com .reflection非法访问。方法java.lang.Class.checkPackageAccess(java.lang.SecurityManager,java.lang.ClassLoader,boolean)
警告:请考虑向org.apache. ibatistics . reflection.reflector的维护者报告此情况
警告:使用——非法访问=warn启用进一步的非法反射访问操作的警告
警告:所有非法访问操作将在未来版本中被拒绝
原因:
JDK9的问题,非法反射,用回JDK8就可以了。
推荐阅读
-
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdb
-
Loading class com.mysql.jdbc.Driver . This is deprecated. The new driver class is com.mysql.cj.jdb
-
Loading class `com.mysql.jdbc.Driver'. This is deprecated.
-
spring boot单元测试类的使用.Loading class `com.mysql.jdbc.Driver'. This is deprecated.
-
Loading class `com.mysql.jdbc.Driver'. This is deprecated警告处理,jdbc更新处
-
Loading class `com.mysql.jdbc.Driver‘. This is deprecated. The new driver class is `com.mysql.cj.jdb
-
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdb
-
Loading class `com.mysql.jdbc.Driver'. This is deprecated 警告异常
-
Loading class `com.mysql.jdbc.Driver'. This is deprecated 警告异常