C3P0 DataSource Config (Connection-Pool)


/ Published in: Java
Save to your folder(s)

Tags: C3P0, datasource, spring, database, java


Copy this code and paste it in your HTML
  1. <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
  2. <property name="driverClass" value="${jdbc.driverClassName}"></property>
  3. <property name="jdbcUrl" value="${jdbc.url}"/>
  4. <property name="user" value="${jdbc.username}"/>
  5. <property name="password" value="${jdbc.password}"/>
  6. <property name="initialPoolSize" value="5"></property>
  7. <property name="minPoolSize" value="5"></property>
  8. <property name="maxPoolSize" value="15"/>
  9. <property name="checkoutTimeout" value="1000"/> <!-- Wartezeit auf freie Pool-Connection -->
  10. <property name="maxStatements" value="50"></property>
  11. <property name="automaticTestTable" value="C3P0_TEST_TABLE"></property>
  12. <property name="testConnectionOnCheckin" value="true"></property>
  13. <property name="idleConnectionTestPeriod" value="60"></property> <!-- in Sekunden -->
  14. </bean>

URL: http://www.mchange.com/projects/c3p0/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.