com.mysql.jdbc.Connection.isValid(I)Z,Driver does not support get/set network timeout for connect错误

上周在使用是springboot出现了个如标题所示的错误,然而,我印象中出现这个错误却不太清除为何,于是跟踪错误进行查看

具体的情况是如下图,在源码中是获取了connection连接对象,而当打开这个连接时出现这样的错误,却说驱动是否最有效,所以决定切换高版本的mysql驱动 jar包。如我的是5.0.5 这时我换成,5.1.47就可以了,然而当我对比我原来的代码中也是用的5.0.5却没有任何问题,但是,如果jar包变为5.1.47或者更高就没问题了,这样是不是因为其他jar包的高版本所受到的阻碍呢。

项目所用jar包如下:

 我有点怀疑是不是因为mybatis版本的影响呢:
当我使用低版本的mybatis的jar包时所有的参数运行不可以了,但应该可以肯定与和这个有关,因为这类的确是这个包中的

所以最终的解决方案,换高本中的,肯定是 无效的原因,但是切换后的确可以了,具体的细节似乎懂了,但确是略知一二而已。就先这样吧。

The error message "An error occurred: com.mysql.cj.jdbc.Driver" usually occurs when you're trying to connect to a MySQL database using Java, specifically using the JDBC (Java Database Connectivity) API and the MySQL Connector/J driver. The `com.mysql.cj.jdbc.Driver` is the JDBC driver for MySQL, but it seems there's an issue during the connection. Here are some possible reasons and solutions: 1. **Driver not found or loaded**: Make sure that the MySQL Connector/J jar (mysql-connector-java-x.x.x.jar) is in your classpath or added as a dependency to your project. You can download it from the official website and add it manually or via build tools like Maven or Gradle. 2. **Incorrect JDBC URL**: Double-check your JDBC URL format, which should look like `jdbc:mysql://[hostname]:[port]/[database]?serverTimezone=[timezone]`. Ensure all parts are correct. 3. **Incorrect credentials**: Verify that you have provided valid username and password for the MySQL user you're trying to connect as. 4. **Database not running**: Confirm if the MySQL server is up and running, and that the specified database exists. 5. **Incompatible versions**: If you're using an older version of the driver with a newer MySQL server, compatibility issues might arise. Upgrade or adjust accordingly. 6. **Error in code**: There could be a coding error, like a missing connection statement, wrong handling of exceptions, or incorrect use of the driver. To resolve this, try these steps, and if the issue persists, please provide more context or the exact code snippet where the error is occurring so I can help further.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

kay三石 [Alay Kay]

你的鼓励是我最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值