博客
关于我
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 ERR! ERESOLVE could not resolve报错
    查看>>
    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 digital envelope routines::unsupported解决方法
    查看>>
    npm install 卡着不动的解决方法
    查看>>
    npm install 报错 EEXIST File exists 的解决方法
    查看>>
    npm install 报错 ERR_SOCKET_TIMEOUT 的解决方法
    查看>>
    npm install 报错 fatal: unable to connect to github.com 的解决方法
    查看>>
    npm install 报错 no such file or directory 的解决方法
    查看>>
    npm install 权限问题
    查看>>
    npm install报错,证书验证失败unable to get local issuer certificate
    查看>>
    npm install无法生成node_modules的解决方法
    查看>>
    npm install的--save和--save-dev使用说明
    查看>>
    npm node pm2相关问题
    查看>>
    npm run build 失败Compiler server unexpectedly exited with code: null and signal: SIGBUS
    查看>>
    npm run build报Cannot find module错误的解决方法
    查看>>
    npm run build部署到云服务器中的Nginx(图文配置)
    查看>>
    npm run dev 报错PS ‘vite‘ 不是内部或外部命令,也不是可运行的程序或批处理文件。
    查看>>
    npm scripts 使用指南
    查看>>
    npm should be run outside of the node repl, in your normal shell
    查看>>