Skip to content

Instantly share code, notes, and snippets.

@iezg
Created December 11, 2012 09:36
Show Gist options
  • Save iezg/4257331 to your computer and use it in GitHub Desktop.
Save iezg/4257331 to your computer and use it in GitHub Desktop.
c3p0 configuration inside app's context
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/">
<Resource
name="jdbc/sample"
auth="Container"
driverClass="com.mysql.jdbc.Driver"
jdbcUrl="jdbc:mysql://localhost:3306/yourdbname"
user="your_user"
password="your_password"
factory="org.apache.naming.factory.BeanFactory"
type="com.mchange.v2.c3p0.ComboPooledDataSource"
maxPoolSize="100"
minPoolSize="10"
acquireIncrement="3"
acquireRetryAttempts = "0"
acquireRetryDelay = "3000"
breakAfterAcquireFailure = "false"
maxConnectionAge = "60"
maxIdleTime = "30"
maxIdleTimeExcessConnections = "10"
idleConnectionTestPeriod = "15"
testConnectionOnCheckout = "true"
preferredTestQuery = "SELECT 1"
debugUnreturnedConnectionStackTraces = "true"
autoCommitOnClose="true"
/>
</Context>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment