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更新处的更多相关文章

  1. Loading class `com.mysql.jdbc.Driver'. This is deprecated警告处理

    com.mysql.jdbc.Driver 和 com.mysql.cj.jdbc.Driver的区别 mysql客户端6以后,数据库驱动com.mysql.jdbc.Driver'已经被弃用了.应当 ...

  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

    Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdb ...

  3. 解决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 ...

  4. 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/ ...

  5. 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 ...

  6. JDBC连接数据库报错:Loading class `com.mysql.jdbc.Driver'. This is deprecated.

    使用JDBC连接数据库时出现报错, 报错内容:Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver cla ...

  7. 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 ...

  8. 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”

  9. 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 ...

随机推荐

  1. ExpressionToSQL

    ExpressionToSql using System; using System.Collections.Generic; using System.Collections.ObjectModel ...

  2. 如何在Ubuntu上在多个PHP版本之间切换 (for swoole)

    摘要: 之前一直用Php7.0,今天想用7.2试下一些特性,安装完之后,切换回7.0却不能再使用7.0的swoole了,原来是切换方式出现了问题 一 从PHP 7.0 切换到 PHP 7.2 Apac ...

  3. 吴恩达深度学习:python中的广播

    1.python中的广播: (1)广播是一种手段,可以让python代码执行得更快,我们来看看python实际如何执行. 下面矩阵列出了100克苹果.牛肉.鸡蛋和蛋白质中含有的碳水化合物.蛋白质和脂肪 ...

  4. 将shell脚本的执行过程和执行结果导入到log文件中

    [root@localhost scripts]# vim ping.sh #!/bin/bash set -x ##分步执行 exec &> /tmp/log.txt ##脚本执行的过 ...

  5. 一、json数组的键和值

    一.json数组的键和值 https://blog.csdn.net/sinat_30224769/article/details/51702203 string test_json = " ...

  6. 【转】在Linux下写一个简单的驱动程序

    转自:https://www.cnblogs.com/amanlikethis/p/4914510.html 本文首先描述了一个可以实际测试运行的驱动实例,然后由此去讨论Linux下驱动模板的要素,以 ...

  7. Saving Tang Monk II HihoCoder - 1828 2018北京赛站网络赛A题

    <Journey to the West>(also <Monkey>) is one of the Four Great Classical Novels of Chines ...

  8. Codeforces 902 树同型构造 多项式长除法构造(辗转相除法)

    A #include <bits/stdc++.h> #define PI acos(-1.0) #define mem(a,b) memset((a),b,sizeof(a)) #def ...

  9. FPDF_CHAR_INFO

    typedef struct { FX_WCHAR m_Unicode; FX_WCHAR m_Charcode; FX_INT32 m_Flag; FX_FLOAT m_FontSize; FX_F ...

  10. 【模板】Lucas定理

    代码如下 #include <bits/stdc++.h> using namespace std; typedef long long LL; const int maxn=1e5+10 ...