title: java.sql.SQLException: Connections could not be acquired from the underlying database
body: <p>I'm using Hibernate, MySQL connection is valid  but I get the following.
  How do I see more details on connection string that it's connecting to?</p>
  
  <pre><code>ERROR SchemaUpdate - could not get database metadata
  java.sql.SQLException: Connections could not be acquired from the underlying database!
          at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
          at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529)
          at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
          at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:78)
          at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare(SuppliedConnectionProviderConnectionHelper.java:51)
          at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
          at org.hibernate.impl.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:356)
          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
  Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
          at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319)
          at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)
          at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)
          at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
          ... 10 more
  ERROR SchemaUpdate - could not complete schema update
  java.sql.SQLException: Connections could not be acquired from the underlying database!
          at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
          at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529)
          at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
          at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:78)
          at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare(SuppliedConnectionProviderConnectionHelper.java:51)
          at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
          at org.hibernate.impl.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:356)
          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
  Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
          at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319)
          at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)
          at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)
          at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
          ... 10 more
  
  ERROR JDBCExceptionReporter - Connections could not be acquired from the underlying database!
  org.hibernate.exception.GenericJDBCException: Cannot open connection
          at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
          at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
          at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
          at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
          at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
          at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
          at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142)
          at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)
          at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1354)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:606)
          at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:342)
          at com.sun.proxy.$Proxy0.beginTransaction(Unknown Source)
  
  Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
          at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
          at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529)
          at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
          at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:78)
          at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
          ... 15 more
  Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
          at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319)
          at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)
          at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)
          at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
          ... 18 more
  </code></pre>
  
  <p>here's my hibernate xml:</p>
  
  <pre><code>&lt;hibernate-configuration&gt;
      &lt;session-factory&gt;
  
          &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
          &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://127.0.0.1:3306/test&lt;/property&gt;
  
          &lt;property name="hibernate.connection.username"&gt;root&lt;/property&gt;
          &lt;property name="hibernate.connection.password"&gt;xxxxxx&lt;/property&gt;
  
          &lt;property name="show_sql"&gt;false&lt;/property&gt;
          &lt;property name="dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
          &lt;property name="hibernate.hbm2ddl.auto"&gt;update&lt;/property&gt;
          &lt;property name="connection.provider_class"&gt;org.hibernate.connection.C3P0ConnectionProvider&lt;/property&gt;
          &lt;property name="hibernate.c3p0.max_statements"&gt;200&lt;/property&gt;
  
          &lt;property name="hibernate.c3p0.min_size"&gt;20&lt;/property&gt;
          &lt;property name="hibernate.c3p0.max_size"&gt;200&lt;/property&gt;
          &lt;property name="hibernate.c3p0.idle_test_period"&gt;300&lt;/property&gt;
          &lt;property name="hibernate.c3p0.timeout"&gt;300&lt;/property&gt;
  
          &lt;property name="hibernate.c3p0.max_statements"&gt;200&lt;/property&gt;
          &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt;
  
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>