【问题标题】:JDBCExceptionReporter - SQL Error: 0, SQLState: 08001JDBCExceptionReporter - SQL 错误:0,SQLState:08001
【发布时间】:2013-03-26 15:56:10
【问题描述】:

我使用 spring、hibernate 和 Jaxb 做了一个 Java 应用程序。

JDBCExceptionReporter - SQL Error: 0, SQLState: 08001
JDBCExceptionReporter - Could not create connection to database server. Attempted reconnect 3 times. Giving up.
JDBCExceptionReporter - SQL Error: 0, SQLState: 08001
JDBCExceptionReporter - Could not create connection to database server. Attempted reconnect 3 times. Giving up.

当我尝试通过循环多次连接数据库时出现上述错误。它适用于最多 50 个请求但在循环超过 50 个时会出现错误。

我正在使用 java 1.7 和 Tomcat 7.0

【问题讨论】:

  • 使用连接池概念
  • 尝试关闭你的连接
  • 请显示包含连接的代码。

标签: java mysql hibernate tomcat


【解决方案1】:
JDBCExceptionReporter - SQL Error: 0, SQLState: 08001 

这可能有多种原因:

  1. 在许多情况下,主要问题是连接的限制。
    如果你有交互并且不使用连接池,可能在数据库中已达到连接限制。

  2. 其他情况是,在JDBC 调色板中,如果连接数(默认 100)多于 BW 作业数(默认 0 表示无限)。

重要提示:“通常需要关闭语句或Resultset 才能重新使用它们”。

【讨论】:

    猜你喜欢
    • 2014-06-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-07
    • 1970-01-01
    • 2021-11-18
    • 2020-01-07
    相关资源
    最近更新 更多