Error:
WARN : org.hibernate.engine.jdbc.spi.SqlExceptionHelper - SQL Error: 0, SQLState: 08S01
ERROR: org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Communications link failure
The data source configuration used initially is as follows
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url"
value="jdbc:mysql://localhost:3306/db_heybar01?useUnicode=true&characterEncoding=UTF-8"/>
<property name="username" value="test"/>
<property name="password" value="test"/>
</bean>
Through the error message and the preliminary judgment of searching is that the number of database connections is not enough, try to change the connection pool:
modified data source configuration:
<bean id="dataSource"
class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="jdbcUrl">
<value>jdbc:mysql://101.201.73.167:3306/db_heybar01?useUnicode=true&characterEncoding=UTF-8</value>
</property>
<property name="properties">
<props>
<prop key="c3p0.minPoolSize">2</prop>
<prop key="c3p0.maxPoolSize">50</prop>
<prop key="c3p0.timeout">5000</prop>
<prop key="c3p0.max_statement">100</prop>
<prop key="c3p0.testConnectionOnCheckout">true</prop>
<prop key="user">nupa01</prop>
<prop key="password">NUPA_mysql_2017</prop>
</props>
</property>
</bean>
Read More:
- Resolve the exception MySQL lontransientconnectionexception: communications link failure during rollback()
- Mysql database error (communications link failure)
- Sqoop import error communications link failure
- When executing hive – f script com.mysql.jdbc . exceptions.jdbc4 .CommunicationsException: Communications link failure
- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure (How to Fix)
- How to Fix SQL Error: 1054, SQLState: 42S22 Unknown column ‘markcardex0_.art_service_time’ in ‘field list’
- SQL error: 156, sqlstate: S1000 error encountered in Hibernate
- SQL Error: 1452, SQLState: 23000
- DB2 SQL ERROR: SQLCODE=-803, SQLSTATE=23505, SQL
- SQL Error: 17059, SQLState: 99999
- Solution to communication link failure with error in idea startup project
- SQL Error: 904, SQLState: 42000
- SQL error: 17006, sqlstate: 99999 invalid column name
- Solve a bug harvest of DB2 (sqlcode = – 805, sqlstate = 51002, error message = DB2 SQL error: sqlcode = – 805, sqlstate = 5100
- Communication link failure when connecting Doris
- DB2 SQL error: SQLCODE: -433, SQLSTATE: 22001, SQLERRMC
- DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703
- DB2 SQL error: sqlcode = – 433, sqlstate = 22001 solved
- DB2 SQL error: sqlcode = – 803, sqlstate = 23505, sqlerrmc = 2 [solution]
- DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=;;,?,?,?,?,?,?,?,?);END-OF-STATEMENT