JDBCExceptionReporter - SQL 错误:0,SQLState:08001

kum*_*mar 3 java mysql tomcat hibernate

我使用 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.
Run Code Online (Sandbox Code Playgroud)

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

我使用java 1.7和Tomcat 7.0

Shr*_*ari 5

JDBCExceptionReporter - SQL Error: 0, SQLState: 08001 
Run Code Online (Sandbox Code Playgroud)

这可能有多种原因:

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

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

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