[英]First connection org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection
I'm having problems with a server in Spring 4 and Mysql with Hibernate, Every first connection it is answering me org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection 我在Spring 4中使用服务器时遇到问题,在Hibernate中使用Mysql时遇到问题,它的每个第一个连接都在回答我org.hibernate.exception.JDBCConnectionException:无法获取JDBC连接
My properties.xml is: 我的properties.xml是:
<persistence-unit name="defaultPersistenceUnit"
transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect" />
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
<property name="hibernate.connection.url"
value="jdbc:mysql://mysql.******?reconnect=true" />
<property name="hibernate.connection.username" value="root" />
<property name="hibernate.connection.password" value="****" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.event.merge.entity_copy_observer"
value="allow" />
<property name="c3p0.acquire_increment" value="1" />
<property name="c3p0.idle_test_period" value="100" />
<property name="c3p0.max_size" value="100" />
<property name="c3p0.max_statements" value="0" />
<property name="c3p0.min_size" value="10" />
<property name="c3p0.timeout" value="100" />
<property name="hibernate.c3p0.preferredTestQuery" value="SELECT 1" />
</properties>
</persistence-unit>
Someone is having the same problem or knows a solution? 有人遇到相同的问题或知道解决方案吗?
Thanks in advance!!! 提前致谢!!!
Try with the following JDBC url 尝试使用以下JDBC URL
jdbc:mysql://localhost:3306/poc
poc is schema name poc是架构名称
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.