Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not

1.版本不正确

在检查mysql-connector-java.jar包版本时我发现自己引入的是8.0.11版本的,网上都是5.x的,瞬间感觉不妙了,因为版本问题真的让人头大。

果不其然就是版本问题。

有两种解决方法:

1.退回到5.x版本,其他配置不变

在这里插入图片描述

2.修改jdbc.properties文件

jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/AppStore?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true

引用和提到了解决"Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: interrupt"错误的方法。根据引用中的建议,可以尝试在database.properties文件中的jdbc.url属性中删除"useSSL=true"或将其改为"useSSL=false"。这种方法可能解决该错误。另外,引用还提到了在jdbc.url中添加"useJDBCCompliantTimezoneShift=true&serverTimezone=UTC"的方法来解决类似的问题。根据这些引用的建议,你可以尝试修改数据库配置文件中的相关设置来解决这个问题。123 #### 引用[.reference_title] - *1* [Failed to obtain JDBC Connectionnested exception is java.sql.SQLException: interrupt (xxl-job)](https://blog.csdn.net/hawinlolo/article/details/112951099)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item] - *2* [Failed to obtain JDBC Connection... nested exception is java.sql.SQLException: Connections could not b](https://blog.csdn.net/qq_50754735/article/details/118965074)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item] - *3* [报错: Failed to obtain JDBC ... nested exception is java.sql.SQLException: The server time....](https://blog.csdn.net/weixin_45678130/article/details/113941434)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item] [ .reference_list ]
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值