Note that there are some explanatory texts on larger screens.

plurals
  1. PONo SQL connection
    text
    copied!<p>Recently I've decided to move from Common DBCP to Tomcat JDBC Connection Pool. I changed bean description (using spring 3.1 + hibernate 4 + tomcat) and was faced with the next issue on my web app start up:</p> <p><strong>HHH000342: Could not obtain connection to query metadata : com.mysql.jdbc.Driver</strong></p> <p>and then when I try to query db from my app I am getting:</p> <p><strong>23:04:40,021 WARN [http-bio-8080-exec-10] spi.SqlExceptionHelper:(SqlExceptionHelper.java:143) - SQL Error: 0, SQLState: null</strong></p> <p><strong>23:04:40,022 ERROR [http-bio-8080-exec-10] spi.SqlExceptionHelper:(SqlExceptionHelper.java:144) - com.mysql.jdbc.Driver</strong></p> <p>I must have done something wrong with configuration so hibernate cannot obtain connection but do not see it. really appreciate if you can point me to the right direction.</p> <p>here is piece of my datasource bean definition</p> <pre><code>&lt;bean id="jdbcDataSource" class="org.apache.tomcat.jdbc.pool.DataSource" destroy- method="close" p:driverClassName="com.mysql.jdbc.Driver" p:url="jdbc:mysql://127.0.0.1:3306/test" p:username="root" p:password="test" p:defaultAutoCommit="false" p:maxActive="100" p:maxIdle="100" p:minIdle="10" p:initialSize="10" p:maxWait="30000" p:testWhileIdle="true" p:validationInterval="60000" p:validationQuery="SELECT 1" p:timeBetweenEvictionRunsMillis="60000" p:minEvictableIdleTimeMillis="600000" p:maxAge="360000" /&gt; </code></pre> <p>and here is how I tie it with spring's session factory</p> <pre><code>&lt;bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt; &lt;property name="dataSource" ref="jdbcDataSource" /&gt;... </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload