com.mchange.v2.c3p0

Class PoolConfig

public final class PoolConfig extends 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 method, and you're off!

For those interested in the details, configuration properties can be specified in several ways:

  1. Any property can be set explicitly by calling the corresponding method on a PoolConfig object.
  2. Any property will default to a value defined by a System Property, using the property name shown the table below.
  3. 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.
  4. 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.

Field Summary
static StringACQUIRE_INCREMENT
static StringACQUIRE_RETRY_ATTEMPTS
static StringACQUIRE_RETRY_DELAY
static StringAUTOMATIC_TEST_TABLE
static StringAUTO_COMMIT_ON_CLOSE
static StringBREAK_AFTER_ACQUIRE_FAILURE
static StringCHECKOUT_TIMEOUT
static StringCONNECTION_TESTER_CLASS_NAME
static StringDEFAULT_CONFIG_RSRC_PATH
static StringFACTORY_CLASS_LOCATION
static StringFORCE_IGNORE_UNRESOLVED_TRANSACTIONS
static StringIDLE_CONNECTION_TEST_PERIOD
static StringINITIAL_POOL_SIZE
static StringMAX_IDLE_TIME
static StringMAX_POOL_SIZE
static StringMAX_STATEMENTS
static StringMAX_STATEMENTS_PER_CONNECTION
static StringMIN_POOL_SIZE
static StringNUM_HELPER_THREADS
static StringPREFERRED_TEST_QUERY
static StringPROPERTY_CYCLE
static StringTEST_CONNECTION_ON_CHECKIN
static StringTEST_CONNECTION_ON_CHECKOUT
static StringUSES_TRADITIONAL_REFLECTIVE_PROXIES
Constructor Summary
PoolConfig(Properties props)
PoolConfig()
Method Summary
static intdefaultAcquireIncrement()
static intdefaultAcquireRetryAttempts()
static intdefaultAcquireRetryDelay()
static booleandefaultAutoCommitOnClose()
static StringdefaultAutomaticTestTable()
static booleandefaultBreakAfterAcquireFailure()
static intdefaultCheckoutTimeout()
static StringdefaultConnectionTesterClassName()
static StringdefaultFactoryClassLocation()
static booleandefaultForceIgnoreUnresolvedTransactions()
static intdefaultIdleConnectionTestPeriod()
static intdefaultInitialPoolSize()
static intdefaultMaxIdleTime()
static intdefaultMaxPoolSize()
static intdefaultMaxStatements()
static intdefaultMaxStatementsPerConnection()
static intdefaultMinPoolSize()
static intdefaultNumHelperThreads()
static StringdefaultPreferredTestQuery()
static intdefaultPropertyCycle()
static booleandefaultTestConnectionOnCheckin()
static booleandefaultTestConnectionOnCheckout()
static booleandefaultUsesTraditionalReflectiveProxies()
intgetAcquireIncrement()
intgetAcquireRetryAttempts()
intgetAcquireRetryDelay()
StringgetAutomaticTestTable()
intgetCheckoutTimeout()
StringgetConnectionTesterClassName()
StringgetFactoryClassLocation()
intgetIdleConnectionTestPeriod()
intgetInitialPoolSize()
intgetMaxIdleTime()
intgetMaxPoolSize()
intgetMaxStatements()
intgetMaxStatementsPerConnection()
intgetMinPoolSize()
intgetNumHelperThreads()
StringgetPreferredTestQuery()
intgetPropertyCycle()
booleangetTestConnectionOnCheckout()
booleanisAutoCommitOnClose()
booleanisBreakAfterAcquireFailure()
booleanisForceIgnoreUnresolvedTransactions()
booleanisTestConnectionOnCheckin()
booleanisTestConnectionOnCheckout()
booleanisUsesTraditionalReflectiveProxies()
voidsetAcquireIncrement(int acquireIncrement)
voidsetAcquireRetryAttempts(int acquireRetryAttempts)
voidsetAcquireRetryDelay(int acquireRetryDelay)
voidsetAutoCommitOnClose(boolean autoCommitOnClose)
voidsetAutomaticTestTable(String automaticTestTable)
voidsetBreakAfterAcquireFailure(boolean breakAfterAcquireFailure)
voidsetCheckoutTimeout(int checkoutTimeout)
voidsetConnectionTesterClassName(String connectionTesterClassName)
voidsetFactoryClassLocation(String factoryClassLocation)
voidsetForceIgnoreUnresolvedTransactions(boolean forceIgnoreUnresolvedTransactions)
voidsetIdleConnectionTestPeriod(int idleConnectionTestPeriod)
voidsetInitialPoolSize(int initialPoolSize)
voidsetMaxIdleTime(int maxIdleTime)
voidsetMaxPoolSize(int maxPoolSize)
voidsetMaxStatements(int maxStatements)
voidsetMaxStatementsPerConnection(int maxStatementsPerConnection)
voidsetMinPoolSize(int minPoolSize)
voidsetNumHelperThreads(int numHelperThreads)
voidsetPreferredTestQuery(String preferredTestQuery)
voidsetPropertyCycle(int propertyCycle)
voidsetTestConnectionOnCheckin(boolean testConnectionOnCheckin)
voidsetTestConnectionOnCheckout(boolean testConnectionOnCheckout)
voidsetUsesTraditionalReflectiveProxies(boolean usesTraditionalReflectiveProxies)

Field Detail

ACQUIRE_INCREMENT

public static final String ACQUIRE_INCREMENT

ACQUIRE_RETRY_ATTEMPTS

public static final String ACQUIRE_RETRY_ATTEMPTS

ACQUIRE_RETRY_DELAY

public static final String ACQUIRE_RETRY_DELAY

AUTOMATIC_TEST_TABLE

public static final String AUTOMATIC_TEST_TABLE

AUTO_COMMIT_ON_CLOSE

public static final String AUTO_COMMIT_ON_CLOSE

BREAK_AFTER_ACQUIRE_FAILURE

public static final String BREAK_AFTER_ACQUIRE_FAILURE

CHECKOUT_TIMEOUT

public static final String CHECKOUT_TIMEOUT

CONNECTION_TESTER_CLASS_NAME

public static final String CONNECTION_TESTER_CLASS_NAME

DEFAULT_CONFIG_RSRC_PATH

public static final String DEFAULT_CONFIG_RSRC_PATH

FACTORY_CLASS_LOCATION

public static final String FACTORY_CLASS_LOCATION

FORCE_IGNORE_UNRESOLVED_TRANSACTIONS

public static final String FORCE_IGNORE_UNRESOLVED_TRANSACTIONS

IDLE_CONNECTION_TEST_PERIOD

public static final String IDLE_CONNECTION_TEST_PERIOD

INITIAL_POOL_SIZE

public static final String INITIAL_POOL_SIZE

MAX_IDLE_TIME

public static final String MAX_IDLE_TIME

MAX_POOL_SIZE

public static final String MAX_POOL_SIZE

MAX_STATEMENTS

public static final String MAX_STATEMENTS

MAX_STATEMENTS_PER_CONNECTION

public static final String MAX_STATEMENTS_PER_CONNECTION

MIN_POOL_SIZE

public static final String MIN_POOL_SIZE

NUM_HELPER_THREADS

public static final String NUM_HELPER_THREADS

PREFERRED_TEST_QUERY

public static final String PREFERRED_TEST_QUERY

PROPERTY_CYCLE

public static final String PROPERTY_CYCLE

TEST_CONNECTION_ON_CHECKIN

public static final String TEST_CONNECTION_ON_CHECKIN

TEST_CONNECTION_ON_CHECKOUT

public static final String TEST_CONNECTION_ON_CHECKOUT

USES_TRADITIONAL_REFLECTIVE_PROXIES

public static final String USES_TRADITIONAL_REFLECTIVE_PROXIES

Constructor Detail

PoolConfig

public PoolConfig(Properties props)

PoolConfig

public PoolConfig()

Method Detail

defaultAcquireIncrement

public static int defaultAcquireIncrement()

defaultAcquireRetryAttempts

public static int defaultAcquireRetryAttempts()

defaultAcquireRetryDelay

public static int defaultAcquireRetryDelay()

defaultAutoCommitOnClose

public static boolean defaultAutoCommitOnClose()

defaultAutomaticTestTable

public static String defaultAutomaticTestTable()

defaultBreakAfterAcquireFailure

public static boolean defaultBreakAfterAcquireFailure()

defaultCheckoutTimeout

public static int defaultCheckoutTimeout()

defaultConnectionTesterClassName

public static String defaultConnectionTesterClassName()

defaultFactoryClassLocation

public static String defaultFactoryClassLocation()

defaultForceIgnoreUnresolvedTransactions

public static boolean defaultForceIgnoreUnresolvedTransactions()

defaultIdleConnectionTestPeriod

public static int defaultIdleConnectionTestPeriod()

defaultInitialPoolSize

public static int defaultInitialPoolSize()

defaultMaxIdleTime

public static int defaultMaxIdleTime()

defaultMaxPoolSize

public static int defaultMaxPoolSize()

defaultMaxStatements

public static int defaultMaxStatements()

defaultMaxStatementsPerConnection

public static int defaultMaxStatementsPerConnection()

defaultMinPoolSize

public static int defaultMinPoolSize()

defaultNumHelperThreads

public static int defaultNumHelperThreads()

defaultPreferredTestQuery

public static String defaultPreferredTestQuery()

defaultPropertyCycle

public static int defaultPropertyCycle()

defaultTestConnectionOnCheckin

public static boolean defaultTestConnectionOnCheckin()

defaultTestConnectionOnCheckout

public static boolean defaultTestConnectionOnCheckout()

defaultUsesTraditionalReflectiveProxies

public static boolean defaultUsesTraditionalReflectiveProxies()

getAcquireIncrement

public int getAcquireIncrement()

getAcquireRetryAttempts

public int getAcquireRetryAttempts()

getAcquireRetryDelay

public int getAcquireRetryDelay()

getAutomaticTestTable

public String getAutomaticTestTable()

getCheckoutTimeout

public int getCheckoutTimeout()

getConnectionTesterClassName

public String getConnectionTesterClassName()

getFactoryClassLocation

public String getFactoryClassLocation()

getIdleConnectionTestPeriod

public int getIdleConnectionTestPeriod()

getInitialPoolSize

public int getInitialPoolSize()

getMaxIdleTime

public int getMaxIdleTime()

getMaxPoolSize

public int getMaxPoolSize()

getMaxStatements

public int getMaxStatements()

getMaxStatementsPerConnection

public int getMaxStatementsPerConnection()

getMinPoolSize

public int getMinPoolSize()

getNumHelperThreads

public int getNumHelperThreads()

getPreferredTestQuery

public String getPreferredTestQuery()

getPropertyCycle

public int getPropertyCycle()

getTestConnectionOnCheckout

public boolean getTestConnectionOnCheckout()

Deprecated: use isTestConnectionOnCheckout

isAutoCommitOnClose

public boolean isAutoCommitOnClose()

isBreakAfterAcquireFailure

public boolean isBreakAfterAcquireFailure()

isForceIgnoreUnresolvedTransactions

public boolean isForceIgnoreUnresolvedTransactions()

isTestConnectionOnCheckin

public boolean isTestConnectionOnCheckin()

isTestConnectionOnCheckout

public boolean isTestConnectionOnCheckout()

isUsesTraditionalReflectiveProxies

public boolean isUsesTraditionalReflectiveProxies()

setAcquireIncrement

public void setAcquireIncrement(int acquireIncrement)

setAcquireRetryAttempts

public void setAcquireRetryAttempts(int acquireRetryAttempts)

setAcquireRetryDelay

public void setAcquireRetryDelay(int acquireRetryDelay)

setAutoCommitOnClose

public void setAutoCommitOnClose(boolean autoCommitOnClose)

setAutomaticTestTable

public void setAutomaticTestTable(String automaticTestTable)

setBreakAfterAcquireFailure

public void setBreakAfterAcquireFailure(boolean breakAfterAcquireFailure)

setCheckoutTimeout

public void setCheckoutTimeout(int checkoutTimeout)

setConnectionTesterClassName

public void setConnectionTesterClassName(String connectionTesterClassName)

setFactoryClassLocation

public void setFactoryClassLocation(String factoryClassLocation)

setForceIgnoreUnresolvedTransactions

public void setForceIgnoreUnresolvedTransactions(boolean forceIgnoreUnresolvedTransactions)

setIdleConnectionTestPeriod

public void setIdleConnectionTestPeriod(int idleConnectionTestPeriod)

setInitialPoolSize

public void setInitialPoolSize(int initialPoolSize)

setMaxIdleTime

public void setMaxIdleTime(int maxIdleTime)

setMaxPoolSize

public void setMaxPoolSize(int maxPoolSize)

setMaxStatements

public void setMaxStatements(int maxStatements)

setMaxStatementsPerConnection

public void setMaxStatementsPerConnection(int maxStatementsPerConnection)

setMinPoolSize

public void setMinPoolSize(int minPoolSize)

setNumHelperThreads

public void setNumHelperThreads(int numHelperThreads)

setPreferredTestQuery

public void setPreferredTestQuery(String preferredTestQuery)

setPropertyCycle

public void setPropertyCycle(int propertyCycle)

setTestConnectionOnCheckin

public void setTestConnectionOnCheckin(boolean testConnectionOnCheckin)

setTestConnectionOnCheckout

public void setTestConnectionOnCheckout(boolean testConnectionOnCheckout)

setUsesTraditionalReflectiveProxies

public void setUsesTraditionalReflectiveProxies(boolean usesTraditionalReflectiveProxies)