com.mchange.v2.c3p0
Class PoolConfig
java.lang.Object
com.mchange.v2.c3p0.PoolConfig
- public final class PoolConfig
- extends java.lang.Object
Encapsulates all the configuration information required by a c3p0 pooled DataSource.
Newly constructed PoolConfig objects are preset with default values,
which you can define yourself (see below),
or you can rely on c3p0's built-in defaults. Just create a PoolConfig object, and change only the
properties you care about. Then pass it to the DataSources.pooledDataSource(javax.sql.DataSource, com.mchange.v2.c3p0.PoolConfig)
method, and you're off!
For those interested in the details, configuration properties can be specified in several ways:
- Any property can be set explicitly by calling the corresponding method on a PoolConfig object.
- Any property will default to a value defined by a System Property, using the property name shown the table below.
- Any property not set in either of the above ways will default to a value found in a user-supplied Java properties file,
which may be placed in the resource path of
the ClassLoader that loaded the c3p0 libraries under the name /c3p0.properties.
- Any property not set in any of the above ways will be defined according c3p0's built-in defaults.
Please see c3p0's main documentation for a description of all available parameters.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INITIAL_POOL_SIZE
public static final java.lang.String INITIAL_POOL_SIZE
- See Also:
- Constant Field Values
MIN_POOL_SIZE
public static final java.lang.String MIN_POOL_SIZE
- See Also:
- Constant Field Values
MAX_POOL_SIZE
public static final java.lang.String MAX_POOL_SIZE
- See Also:
- Constant Field Values
IDLE_CONNECTION_TEST_PERIOD
public static final java.lang.String IDLE_CONNECTION_TEST_PERIOD
- See Also:
- Constant Field Values
MAX_IDLE_TIME
public static final java.lang.String MAX_IDLE_TIME
- See Also:
- Constant Field Values
PROPERTY_CYCLE
public static final java.lang.String PROPERTY_CYCLE
- See Also:
- Constant Field Values
MAX_STATEMENTS
public static final java.lang.String MAX_STATEMENTS
- See Also:
- Constant Field Values
MAX_STATEMENTS_PER_CONNECTION
public static final java.lang.String MAX_STATEMENTS_PER_CONNECTION
- See Also:
- Constant Field Values
CHECKOUT_TIMEOUT
public static final java.lang.String CHECKOUT_TIMEOUT
- See Also:
- Constant Field Values
ACQUIRE_INCREMENT
public static final java.lang.String ACQUIRE_INCREMENT
- See Also:
- Constant Field Values
ACQUIRE_RETRY_ATTEMPTS
public static final java.lang.String ACQUIRE_RETRY_ATTEMPTS
- See Also:
- Constant Field Values
ACQUIRE_RETRY_DELAY
public static final java.lang.String ACQUIRE_RETRY_DELAY
- See Also:
- Constant Field Values
BREAK_AFTER_ACQUIRE_FAILURE
public static final java.lang.String BREAK_AFTER_ACQUIRE_FAILURE
- See Also:
- Constant Field Values
USES_TRADITIONAL_REFLECTIVE_PROXIES
public static final java.lang.String USES_TRADITIONAL_REFLECTIVE_PROXIES
- See Also:
- Constant Field Values
TEST_CONNECTION_ON_CHECKOUT
public static final java.lang.String TEST_CONNECTION_ON_CHECKOUT
- See Also:
- Constant Field Values
TEST_CONNECTION_ON_CHECKIN
public static final java.lang.String TEST_CONNECTION_ON_CHECKIN
- See Also:
- Constant Field Values
CONNECTION_TESTER_CLASS_NAME
public static final java.lang.String CONNECTION_TESTER_CLASS_NAME
- See Also:
- Constant Field Values
AUTOMATIC_TEST_TABLE
public static final java.lang.String AUTOMATIC_TEST_TABLE
- See Also:
- Constant Field Values
AUTO_COMMIT_ON_CLOSE
public static final java.lang.String AUTO_COMMIT_ON_CLOSE
- See Also:
- Constant Field Values
FORCE_IGNORE_UNRESOLVED_TRANSACTIONS
public static final java.lang.String FORCE_IGNORE_UNRESOLVED_TRANSACTIONS
- See Also:
- Constant Field Values
NUM_HELPER_THREADS
public static final java.lang.String NUM_HELPER_THREADS
- See Also:
- Constant Field Values
PREFERRED_TEST_QUERY
public static final java.lang.String PREFERRED_TEST_QUERY
- See Also:
- Constant Field Values
FACTORY_CLASS_LOCATION
public static final java.lang.String FACTORY_CLASS_LOCATION
- See Also:
- Constant Field Values
DEFAULT_CONFIG_RSRC_PATH
public static final java.lang.String DEFAULT_CONFIG_RSRC_PATH
- See Also:
- Constant Field Values
PoolConfig
public PoolConfig(java.util.Properties props)
throws java.lang.NumberFormatException
PoolConfig
public PoolConfig()
throws java.lang.NumberFormatException
defaultNumHelperThreads
public static int defaultNumHelperThreads()
defaultPreferredTestQuery
public static java.lang.String defaultPreferredTestQuery()
defaultFactoryClassLocation
public static java.lang.String defaultFactoryClassLocation()
defaultMaxStatements
public static int defaultMaxStatements()
defaultMaxStatementsPerConnection
public static int defaultMaxStatementsPerConnection()
defaultInitialPoolSize
public static int defaultInitialPoolSize()
defaultMinPoolSize
public static int defaultMinPoolSize()
defaultMaxPoolSize
public static int defaultMaxPoolSize()
defaultIdleConnectionTestPeriod
public static int defaultIdleConnectionTestPeriod()
defaultMaxIdleTime
public static int defaultMaxIdleTime()
defaultPropertyCycle
public static int defaultPropertyCycle()
defaultCheckoutTimeout
public static int defaultCheckoutTimeout()
defaultAcquireIncrement
public static int defaultAcquireIncrement()
defaultAcquireRetryAttempts
public static int defaultAcquireRetryAttempts()
defaultAcquireRetryDelay
public static int defaultAcquireRetryDelay()
defaultBreakAfterAcquireFailure
public static boolean defaultBreakAfterAcquireFailure()
defaultConnectionTesterClassName
public static java.lang.String defaultConnectionTesterClassName()
defaultAutomaticTestTable
public static java.lang.String defaultAutomaticTestTable()
defaultTestConnectionOnCheckout
public static boolean defaultTestConnectionOnCheckout()
defaultTestConnectionOnCheckin
public static boolean defaultTestConnectionOnCheckin()
defaultAutoCommitOnClose
public static boolean defaultAutoCommitOnClose()
defaultForceIgnoreUnresolvedTransactions
public static boolean defaultForceIgnoreUnresolvedTransactions()
defaultUsesTraditionalReflectiveProxies
public static boolean defaultUsesTraditionalReflectiveProxies()
getNumHelperThreads
public int getNumHelperThreads()
getPreferredTestQuery
public java.lang.String getPreferredTestQuery()
getFactoryClassLocation
public java.lang.String getFactoryClassLocation()
getMaxStatements
public int getMaxStatements()
getMaxStatementsPerConnection
public int getMaxStatementsPerConnection()
getInitialPoolSize
public int getInitialPoolSize()
getMinPoolSize
public int getMinPoolSize()
getMaxPoolSize
public int getMaxPoolSize()
getIdleConnectionTestPeriod
public int getIdleConnectionTestPeriod()
getMaxIdleTime
public int getMaxIdleTime()
getPropertyCycle
public int getPropertyCycle()
getAcquireIncrement
public int getAcquireIncrement()
getCheckoutTimeout
public int getCheckoutTimeout()
getAcquireRetryAttempts
public int getAcquireRetryAttempts()
getAcquireRetryDelay
public int getAcquireRetryDelay()
isBreakAfterAcquireFailure
public boolean isBreakAfterAcquireFailure()
isUsesTraditionalReflectiveProxies
public boolean isUsesTraditionalReflectiveProxies()
getConnectionTesterClassName
public java.lang.String getConnectionTesterClassName()
getAutomaticTestTable
public java.lang.String getAutomaticTestTable()
getTestConnectionOnCheckout
public boolean getTestConnectionOnCheckout()
- Deprecated. use isTestConnectionOnCheckout
isTestConnectionOnCheckout
public boolean isTestConnectionOnCheckout()
isTestConnectionOnCheckin
public boolean isTestConnectionOnCheckin()
isAutoCommitOnClose
public boolean isAutoCommitOnClose()
isForceIgnoreUnresolvedTransactions
public boolean isForceIgnoreUnresolvedTransactions()
setNumHelperThreads
public void setNumHelperThreads(int numHelperThreads)
setPreferredTestQuery
public void setPreferredTestQuery(java.lang.String preferredTestQuery)
setFactoryClassLocation
public void setFactoryClassLocation(java.lang.String factoryClassLocation)
setMaxStatements
public void setMaxStatements(int maxStatements)
setMaxStatementsPerConnection
public void setMaxStatementsPerConnection(int maxStatementsPerConnection)
setInitialPoolSize
public void setInitialPoolSize(int initialPoolSize)
setMinPoolSize
public void setMinPoolSize(int minPoolSize)
setMaxPoolSize
public void setMaxPoolSize(int maxPoolSize)
setIdleConnectionTestPeriod
public void setIdleConnectionTestPeriod(int idleConnectionTestPeriod)
setMaxIdleTime
public void setMaxIdleTime(int maxIdleTime)
setPropertyCycle
public void setPropertyCycle(int propertyCycle)
setCheckoutTimeout
public void setCheckoutTimeout(int checkoutTimeout)
setAcquireIncrement
public void setAcquireIncrement(int acquireIncrement)
setAcquireRetryAttempts
public void setAcquireRetryAttempts(int acquireRetryAttempts)
setAcquireRetryDelay
public void setAcquireRetryDelay(int acquireRetryDelay)
setConnectionTesterClassName
public void setConnectionTesterClassName(java.lang.String connectionTesterClassName)
setAutomaticTestTable
public void setAutomaticTestTable(java.lang.String automaticTestTable)
setBreakAfterAcquireFailure
public void setBreakAfterAcquireFailure(boolean breakAfterAcquireFailure)
setUsesTraditionalReflectiveProxies
public void setUsesTraditionalReflectiveProxies(boolean usesTraditionalReflectiveProxies)
setTestConnectionOnCheckout
public void setTestConnectionOnCheckout(boolean testConnectionOnCheckout)
setTestConnectionOnCheckin
public void setTestConnectionOnCheckin(boolean testConnectionOnCheckin)
setAutoCommitOnClose
public void setAutoCommitOnClose(boolean autoCommitOnClose)
setForceIgnoreUnresolvedTransactions
public void setForceIgnoreUnresolvedTransactions(boolean forceIgnoreUnresolvedTransactions)