简体   繁体   English

第一次连接org.hibernate.exception.JDBCConnectionException:无法获取JDBC连接

[英]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.

相关问题 无法获得隔离的 JDBC 连接:org.hibernate.exception.JDBCConnectionException - Unable to obtain isolated JDBC connection: org.hibernate.exception.JDBCConnectionException org.hibernate.exception.JDBCConnectionException:无法为 DDL 执行打开 JDBC 连接 - org.hibernate.exception.JDBCConnectionException: Unable to open JDBC Connection for DDL execution org.hibernate.exception.JDBCConnectionException:无法在MySQL中打开连接异常 - org.hibernate.exception.JDBCConnectionException: Could not open connection exception in MySQL org.hibernate.exception.JDBCConnectionException:无法打开连接 - org.hibernate.exception.JDBCConnectionException: Cannot open connection org.hibernate.exception.JDBCConnectionException:无法打开连接 - org.hibernate.exception.JDBCConnectionException: Cannot open connection org.hibernate.exception.JDBCConnectionException:无法打开连接 - org.hibernate.exception.JDBCConnectionException: Could not open connection JDBCConnectionException:无法获取 JDBC 连接 - JDBCConnectionException: Unable to acquire JDBC Connection org.hibernate.exception.JDBCConnectionException - org.hibernate.exception.JDBCConnectionException 无法打开 Hibernate Session 进行事务; 嵌套异常是 org.hibernate.exception.JDBCConnectionException:无法打开连接 - Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Could not open connection Hibernate在多线程应用程序中随机抛出“ org.hibernate.exception.JDBCConnectionException:无法打开连接” - Hibernate throw “org.hibernate.exception.JDBCConnectionException: Could not open connection” Randomly in a Multi-Thread application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM