博客
关于我
Jmeter-更新数据库驱动信息
阅读量:500 次
发布时间:2019-03-07

本文共 721 字,大约阅读时间需要 2 分钟。

JDK版本升级可能会引发数据库驱动兼容性的问题,如果你遇到以下错误提示:

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.

请注意以下几点:

  • 确定JDK版本

    首先, 确认系统上的JDK版本是否已经升级到最新版本. 如果JDK版本较旧, 可能无法直接使用新的数据库驱动.

  • 移除旧驱动

    在项目路径中, 删除com.mysql.jdbc.Driver.class文件. 这是因为新版本的MySQL驱动已经通过SPI机制自动注册, 不需要手动加载.

  • 配置Maven项目

    如果是Maven项目, 在pom.xml文件中添加MySQL连接池依赖:

  • com.mysql
    mysql-connector-j](https://mvnrepository.com/search/
    1. 测试数据库连接
      确保替换新的驱动后, 重新测试数据库连接是否正常, 包括数据库用户名、密码、URL等配置信息是否正确.
    2. 如果问题仍然存在, 请检查MySQL官方文档, 确认是否需要额外配置或许<此外,可参考以下文档获取帮助](https://dev.mysql.com/doc/refman/).

    转载地址:http://efnjz.baihongyu.com/

    你可能感兴趣的文章
    npm should be run outside of the node repl, in your normal shell
    查看>>
    npm start运行了什么
    查看>>
    npm WARN deprecated core-js@2.6.12 core-js@<3.3 is no longer maintained and not recommended for usa
    查看>>
    npm 下载依赖慢的解决方案(亲测有效)
    查看>>
    npm 安装依赖过程中报错:Error: Can‘t find Python executable “python“, you can set the PYTHON env variable
    查看>>
    npm.taobao.org 淘宝 npm 镜像证书过期?这样解决!
    查看>>
    npm—小记
    查看>>
    npm介绍以及常用命令
    查看>>
    NPM使用前设置和升级
    查看>>
    npm入门,这篇就够了
    查看>>
    npm切换到淘宝源
    查看>>
    npm切换源淘宝源的两种方法
    查看>>
    npm前端包管理工具简介---npm工作笔记001
    查看>>
    npm升级以及使用淘宝npm镜像
    查看>>
    npm发布包--所遇到的问题
    查看>>
    npm发布自己的组件UI包(详细步骤,图文并茂)
    查看>>
    npm和yarn清理缓存命令
    查看>>
    npm和yarn的使用对比
    查看>>
    npm如何清空缓存并重新打包?
    查看>>
    npm学习(十一)之package-lock.json
    查看>>