Loading class `com.mysql.jdbc.Driver'. This is deprecated警告处理,jdbc更新处
1.报错信息是这样的;

处理:提示信息表明数据库驱动com.mysql.jdbc.Driver'已经被弃用了、应当使用新的驱动com.mysql.cj.jdbc.Driver'
所以,按照提示更改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 满足其要求即可,如下:
"jdbc:mysql://localhost:3306/mybatis?characterEncoding=utf-8&serverTimezone=UTC&useSSL=false"
2.1、这里是配置了jdbc.properties,完整配置如下:
jdbc.DriverClassName=com.mysql.cj.jdbc.Driver
jdbc.url =jdbc:mysql://localhost:3306/student?serverTimezone=UTC&useSSL=false
jdbc.username=root
jdbc.password=root
2.2、mybatis-config.xml 中引入配置文件、配置数据源如下:
<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就可以了。JDK9版本作为小版本,相对JDK8,以及新出的JDK11这些长期版本来讲、有些许BUG正常,针对这个问题,我看了官方社区,有给出答案说是在未来可能对该问题进行优化处理,并不影响使用;
PS:在框架以后,建议小伙伴都使用JDK8版本开发学习,毕竟好多产品最近更新都已支持到了JDK8、并且、使用重量级的WEB服务器 weblogic 也仅仅支持到JDK8;
---------------------
作者:打豆豆。
来源:CSDN
原文:https://blog.csdn.net/weixin_42323802/article/details/82500458
版权声明:本文为博主原创文章,转载请附上博文链接!
Loading class `com.mysql.jdbc.Driver'. This is deprecated警告处理,jdbc更新处的更多相关文章
- Loading class `com.mysql.jdbc.Driver'. This is deprecated警告处理
com.mysql.jdbc.Driver 和 com.mysql.cj.jdbc.Driver的区别 mysql客户端6以后,数据库驱动com.mysql.jdbc.Driver'已经被弃用了.应当 ...
- 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
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.jdbc.Driver'.
异常: Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj ...
- Eclipse中使用MySql遇到: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 o
在Eclipse中使用MySQL遇到了点小问题 如果对Eclipse中配置MySql还有疑问的可以参考一下这篇博客:https://blog.csdn.net/qq_38247544/article/ ...
- mysql 问题 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.c ...
- JDBC连接数据库报错:Loading class `com.mysql.jdbc.Driver'. This is deprecated.
使用JDBC连接数据库时出现报错, 报错内容:Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver cla ...
- Cannot create JDBC driver of class '' for connect URL 'jdbc:mysql://127.0.0.1:3306/test'
原来的配置如下: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http ...
- Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'.
在连接数据库时,使用了最新版本的mysql-Connector,所以导致老版本的“com.mysql.jdbc.Drive”不可行,要改为“com.mysql.cj.jdbc.Driver”
- Loading class `com.mysql.jdbc.Driver'. This is deprecated. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
简单介绍 声明:使用JDK9.MYSQL8.idea 报错处理 报错信息如下 原因 提示信息表明数据库驱动com.mysql.jdbc.Driver已经被弃用了.应当使用新的驱动com.mysql.c ...
随机推荐
- Java中遍历Set集合的方法
对 set 的遍历 1.迭代遍历: Set<String> set = new HashSet<String>(); Iterator<String> it = s ...
- sql server查询在线用户
select request_session_id spid, object_name(resource_associated_entity_id) tableName from sys.dm_tra ...
- Azure云服务托管恶意软件
微软Azure云服务被用于托管恶意软件,可控制多达90台电脑 BleepingComputer称,在早期报道中,5月份陆续出现了两起与Azure相关的恶意软件攻击事件: 1.自5月10日以来,Azur ...
- Linux中文件查找,压缩和打包指令
1.文件的查找和搜索 可执行文件的搜索:which .whereis locate搜索文件 find搜索文件 1.1可执行文件的搜索 在Linux系统中,有成百上千个指令,不同 ...
- liunx weblogic服务启停脚本
#!/bin/bash #sh xx.sh start xx项目 例如:sh autoWeblogic.sh start bius #经测试发现weblogic 启动大概需要完全启动成功35秒左右 停 ...
- DP | Luogu P1466 集合 Subset Sums
题面:P1466 集合 Subset Sums 题解: dpsum=N*(N+1)/2;模型转化为求选若干个数,填满sum/2的空间的方案数,就是背包啦显然如果sum%2!=0是没有答案的,就特判掉F ...
- 远程连接工具rdcman
介绍一个远程连接的工具RDCMan.RDCMan全称Remote Desktop Connection Manager(多远程桌面管理)是微软Windows Live体验团队的主要开发者 Julian ...
- CSS-overflow-scroll 滑动粘手
长列表的滑动,CSS属性给了 overflow: auto:在IOS上可能会出现“粘手”效果,即滑动很慢.卡顿.粘手 解决: 启动硬件加速渲染: -webkit-overflow-scrolling: ...
- UIScrollView的简单使用
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:self.view.bounds]; //将scrollView添加到当前 ...
- vue 路由拦截器和请求拦截器
路由拦截器 已路由为导向 router.beforeEach((to,from,next)=>{ if(to.path=='/login' || localStorage.getItem('to ...