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. flask中使用jsonify和json.dumps的区别

    一.实验 python的flask框架为用户提供了直接返回包含json格式数据响应的方法,即jsonify,在开发中会经常用到.如下一段简单的flask后端代码,服务端视图函数根据请求参数返回json ...

  2. 对Elastic集群内部配置TLS加密通信及身份验证

    1.介绍 官方宣布从6.8和7.1开始,免费提供多项安全功能.其中包括tls加密通信,基于角色访问控制等功能. 可以使用企业CA证书来完成这一步骤,但是一般情况下,我们可以通过elasticsearc ...

  3. PhpStorm 2017.3-2018.2 汉化包

    JetBrains 系列软件汉化包 关键字: Android Studio 3.0-3.1.3 汉化包 CLion 2018.1-2018.2 汉化包 GoLand 2017.3.2-2018.2 汉 ...

  4. VMware安装,安装CentOS 6.3 ,安装CentOS 7_1511_mini

    VMware安装包+汉化包+序列号 百度云链接:https://pan.baidu.com/s/1c8ZsZc9ySdCdxrywFO4eUA 提取码:iq7k 打开 VMware Workstati ...

  5. Delphi 帮助的使用

  6. 第一节,搭建openwrt开发环境

    一,安装VMware虚拟机或者VirtualBox虚拟机 安装过程就不在此赘述了.附上百度搜索来的链接,供大家参考. https://baijiahao.baidu.com/s?id=16233731 ...

  7. PAT Basic 1038 统计同成绩学生 (20 分)

    本题要求读入 N 名学生的成绩,将获得某一给定分数的学生人数输出. 输入格式: 输入在第 1 行给出不超过 1 的正整数 N,即学生总人数.随后一行给出 N 名学生的百分制整数成绩,中间以空格分隔.最 ...

  8. Codeforces Round #575 (Div. 3) (A. Three Piles of Candies)(数学)

    A. Three Piles of Candies time limit per test1 second memory limit per test256 megabytes inputstanda ...

  9. [易学易懂系列|rustlang语言|零基础|快速入门|(9)|Control Flows流程控制]

    [易学易懂系列|rustlang语言|零基础|快速入门|(9)] 有意思的基础知识 Control Flows 我们今天再来看看流程控制. 条件控制 if-else if -else: / Simpl ...

  10. 2019强网杯web upload分析(pop链)

    参考链接:https://blog.csdn.net/qq_41173457/article/details/90724943 注意 只要namespace相同那就可以直接实例化同一namespace ...