博客
关于我
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/

    你可能感兴趣的文章
    nowcoder—Beauty of Trees
    查看>>
    np.arange()和np.linspace()绘制logistic回归图像时得到不同的结果?
    查看>>
    np.power的使用
    查看>>
    NPM 2FA双重认证的设置方法
    查看>>
    npm build报错Cannot find module ‘webpack/lib/rules/BasicEffectRulePlugin‘解决方法
    查看>>
    npm build报错Cannot find module ‘webpack‘解决方法
    查看>>
    npm ERR! ERESOLVE could not resolve报错
    查看>>
    npm ERR! fatal: unable to connect to github.com:
    查看>>
    npm ERR! Unexpected end of JSON input while parsing near '...on":"0.10.3","direc to'
    查看>>
    npm ERR! Unexpected end of JSON input while parsing near ‘...“:“^1.2.0“,“vue-html-‘ npm ERR! A comp
    查看>>
    npm error Missing script: “server“npm errornpm error Did you mean this?npm error npm run serve
    查看>>
    npm error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,1) 安装
    查看>>
    npm install CERT_HAS_EXPIRED解决方法
    查看>>
    npm install digital envelope routines::unsupported解决方法
    查看>>
    npm install 卡着不动的解决方法
    查看>>
    npm install 报错 EEXIST File exists 的解决方法
    查看>>
    npm install 报错 ERR_SOCKET_TIMEOUT 的解决方法
    查看>>
    npm install 报错 Failed to connect to github.com port 443 的解决方法
    查看>>
    npm install 报错 fatal: unable to connect to github.com 的解决方法
    查看>>
    npm install 报错 no such file or directory 的解决方法
    查看>>