Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
时间: 2023-08-28 20:19:34 浏览: 79
这个错误的原因是无法获得 JDBC 连接,可能是数据库服务未启动或者连接信息配置错误。另外,根据错误信息中的“Attempted reconnect 3 times. Giving up.”,也可以看出连接数据库时尝试了三次重连,但都失败了。建议检查数据库服务是否启动正常,以及连接信息是否正确,如用户名、密码、数据库名称、端口号等。如果问题仍然存在,可以尝试查看数据库的错误日志,以获取更多的信息。
相关问题
cause: org.springframework.jdbc.cannotgetjdbcconnectionexception: failed to obtain jdbc connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.communicationsexception: communications link failure
这是一个错误信息,其中包含了两个异常。第一个异常是org.springframework.jdbc.cannotgetjdbcconnectionexception,意思是无法获取JDBC连接。第二个异常是com.mysql.jdbc.exceptions.jdbc4.communicationsexception,意思是通信连接失败。可能是数据库连接设置有误或者数据库出现了问题。需要进一步排查问题。
nested exception is org.apache.ibatis.exceptions.PersistenceException Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection
eption is java.sql.sqlexception: cannot create poolableconnectionfactory (could not create connection to database server. attempted reconnect 3 times. giving up.)
这是一个MyBatis和Spring集成的异常,原因是查询数据库时出现了错误。具体原因是无法获取JDBC连接,可能是由于连接数据库服务器时出现了问题。已经尝试重新连接3次,但仍然无法连接。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![application/octet-stream](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![sb3](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)