Top Description Fields Constructors Methods
com.mchange.v2.c3p0

public abstract Class AbstractComboPooledDataSource

extends AbstractPoolBackedDataSource
implements PooledDataSource, Serializable, Referenceable
Class Inheritance
All Implemented Interfaces
javax.naming.Referenceable, java.io.Serializable, com.mchange.v2.c3p0.PooledDataSource, java.lang.AutoCloseable, javax.sql.DataSource, java.sql.Wrapper, javax.sql.CommonDataSource
Known Direct Subclasses
com.mchange.v2.c3p0.ComboPooledDataSource, com.mchange.v2.c3p0.debug.AfterCloseLoggingComboPooledDataSource, com.mchange.v2.c3p0.debug.CloseLoggingComboPooledDataSource, com.mchange.v2.c3p0.debug.ConstructionLoggingComboPooledDataSource
Imports
java.beans.*, java.io.*, java.sql.*, java.util.*, javax.naming.*, com.mchange.v2.log.*, com.mchange.v2.naming.*, com.mchange.v2.c3p0.impl.*, javax.sql.DataSource, com.mchange.v2.beans.BeansUtils, com.mchange.v2.c3p0.cfg.C3P0Config, com.mchange.v2.lang.ObjectUtils

For the meaning of most of these properties, please see c3p0's top-level documentation!

Field Summary

Modifier and TypeField and Description
pack-priv transient DriverManagerDataSource
pack-priv static final MLogger
private static final long
pack-priv static final Set<E>
private static final short
pack-priv transient WrapperConnectionPoolDataSource

Constructor Summary

AccessConstructor and Description
public
public
AbstractComboPooledDataSource(boolean autoregister)

public

Method Summary

Modifier and TypeMethod and Description
private static boolean
diff(int a, int b)

private static boolean
diff(boolean a, boolean b)

private static boolean
public int
public int
public int
public String
public int
public String
public int
public String
public String
public String
public String
public String
public int
public int
public String
public String
public int
public int
public int
public int
public int
public int
public int
public int
public String
public String
public String
public String
public Properties
public int
public int
public String
public int
public String
public Map<K, V>
public String
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
isWrapperFor(Class<?>
a Class defining an interface.
iface
)

Overrides com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.isWrapperFor.

Implements java.sql.Wrapper.isWrapperFor.

Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.

private boolean
private void
public void
setAcquireIncrement(int acquireIncrement)

public void
setAcquireRetryAttempts(int acquireRetryAttempts)

public void
setAcquireRetryDelay(int acquireRetryDelay)

public void
setAttemptResurrectOnCheckin(boolean attemptResurrectOnCheckin)

public void
setAutoCommitOnClose(boolean autoCommitOnClose)

public void
setAutomaticTestTable(String automaticTestTable)

public void
setBreakAfterAcquireFailure(boolean breakAfterAcquireFailure)

public void
setCheckoutTimeout(int checkoutTimeout)

public void
setConnectionCustomizerClassName(String connectionCustomizerClassName)

public void
setConnectionIsValidTimeout(int connectionIsValidTimeout)

public void
setConnectionTesterClassName(String connectionTesterClassName)

public void
setContextClassLoaderSource(String contextClassLoaderSource)

public void
setDebugUnreturnedConnectionStackTraces(boolean debugUnreturnedConnectionStackTraces)

public void
setDescription(String description)

public void
setDriverClass(String driverClass)

public void
public void
setForceIgnoreUnresolvedTransactions(boolean forceIgnoreUnresolvedTransactions)

public void
setForceSynchronousCheckins(boolean forceSynchronousCheckins)

public void
setForceUseNamedDriverClass(boolean forceUseNamedDriverClass)

public void
setIdleConnectionTestPeriod(int idleConnectionTestPeriod)

public void
setInitialPoolSize(int initialPoolSize)

public void
setJdbcUrl(String jdbcUrl)

public void
setMarkSessionBoundaries(String markSessionBoundaries)

public void
setMaxAdministrativeTaskTime(int maxAdministrativeTaskTime)

public void
setMaxConnectionAge(int maxConnectionAge)

public void
setMaxIdleTime(int maxIdleTime)

public void
setMaxIdleTimeExcessConnections(int maxIdleTimeExcessConnections)

public void
setMaxPoolSize(int maxPoolSize)

public void
setMaxStatements(int maxStatements)

public void
setMaxStatementsPerConnection(int maxStatementsPerConnection)

public void
setMinPoolSize(int minPoolSize)

public void
setOverrideDefaultPassword(String overrideDefaultPassword)

public void
setOverrideDefaultUser(String overrideDefaultUser)

public void
setPassword(String password)

public void
setPreferredTestQuery(String preferredTestQuery)

public void
setPrivilegeSpawnedThreads(boolean privilegeSpawnedThreads)

public void
public void
setPropertyCycle(int propertyCycle)

public void
setStatementCacheNumDeferredCloseThreads(int statementCacheNumDeferredCloseThreads)

public void
setTaskRunnerFactoryClassName(String taskRunnerFactoryClassName)

public void
setTestConnectionOnCheckin(boolean testConnectionOnCheckin)

public void
setTestConnectionOnCheckout(boolean testConnectionOnCheckout)

public void
setUnreturnedConnectionTimeout(int unreturnedConnectionTimeout)

private void
public void
public void
public String
toString()

Overrides com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase.toString.

Returns a string representation of the object.

public String
public <T> T
unwrap(Class<T>
A Class defining an interface that the result must implement.
iface
)

Overrides com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.unwrap.

Implements java.sql.Wrapper.unwrap.

Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.

private void
private void
Inherited from com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource:
closeclosegetAllUsersgetConnectiongetConnectiongetDataSourceNamegetEffectivePropertyCyclegetEffectivePropertyCycleDefaultUsergetLastAcquisitionFailuregetLastAcquisitionFailureDefaultUsergetLastCheckinFailuregetLastCheckinFailureDefaultUsergetLastCheckoutFailuregetLastCheckoutFailureDefaultUsergetLastConnectionTestFailuregetLastConnectionTestFailureDefaultUsergetLastIdleTestFailuregetLastIdleTestFailureDefaultUsergetLoginTimeoutgetLogWritergetNumBusyConnectionsgetNumBusyConnectionsgetNumBusyConnectionsAllUsersgetNumBusyConnectionsDefaultUsergetNumConnectionsgetNumConnectionsgetNumConnectionsAllUsersgetNumConnectionsDefaultUsergetNumFailedCheckinsgetNumFailedCheckinsDefaultUsergetNumFailedCheckoutsgetNumFailedCheckoutsDefaultUsergetNumFailedIdleTestsgetNumFailedIdleTestsDefaultUsergetNumIdleConnectionsgetNumIdleConnectionsgetNumIdleConnectionsAllUsersgetNumIdleConnectionsDefaultUsergetNumThreadsAwaitingCheckoutgetNumThreadsAwaitingCheckoutDefaultUsergetNumUnclosedOrphanedConnectionsgetNumUnclosedOrphanedConnectionsgetNumUnclosedOrphanedConnectionsAllUsersgetNumUnclosedOrphanedConnectionsDefaultUsergetNumUserPoolsgetStartTimeMillisgetStartTimeMillisDefaultUsergetStatementCacheNumCheckedOutgetStatementCacheNumCheckedOutDefaultUsergetStatementCacheNumCheckedOutStatementsAllUsersgetStatementCacheNumConnectionsWithCachedStatementsgetStatementCacheNumConnectionsWithCachedStatementsAllUsersgetStatementCacheNumConnectionsWithCachedStatementsDefaultUsergetStatementCacheNumStatementsgetStatementCacheNumStatementsAllUsersgetStatementCacheNumStatementsDefaultUsergetStatementDestroyerNumActiveThreadsgetStatementDestroyerNumConnectionsInUsegetStatementDestroyerNumConnectionsInUseAllUsersgetStatementDestroyerNumConnectionsInUseDefaultUsergetStatementDestroyerNumConnectionsWithDeferredDestroyStatementsgetStatementDestroyerNumConnectionsWithDeferredDestroyStatementsAllUsersgetStatementDestroyerNumConnectionsWithDeferredDestroyStatementsDefaultUsergetStatementDestroyerNumDeferredDestroyStatementsgetStatementDestroyerNumDeferredDestroyStatementsAllUsersgetStatementDestroyerNumDeferredDestroyStatementsDefaultUsergetStatementDestroyerNumIdleThreadsgetStatementDestroyerNumTasksPendinggetStatementDestroyerNumThreadsgetThreadPoolNumActiveThreadsgetThreadPoolNumIdleThreadsgetThreadPoolNumTasksPendinggetThreadPoolSizegetUpTimeMillisgetUpTimeMillisDefaultUserhardResetinitializeNamedConfigisWrapperForThisresetPoolManagerresetPoolManagersampleLastAcquisitionFailureStackTracesampleLastAcquisitionFailureStackTraceDefaultUsersampleLastCheckinFailureStackTracesampleLastCheckinFailureStackTraceDefaultUsersampleLastCheckoutFailureStackTracesampleLastCheckoutFailureStackTraceDefaultUsersampleLastConnectionTestFailureStackTracesampleLastConnectionTestFailureStackTraceDefaultUsersampleLastIdleTestFailureStackTracesampleLastIdleTestFailureStackTraceDefaultUsersampleStatementCacheStatussampleStatementCacheStatusDefaultUsersampleStatementDestroyerStackTracessampleStatementDestroyerStatussampleThreadPoolStackTracessampleThreadPoolStatussetLoginTimeoutsetLogWritersoftResetsoftResetAllUserssoftResetDefaultUser

Field Detail

dmdsback to summary
pack-priv transient DriverManagerDataSource dmds
loggerback to summary
pack-priv static final MLogger logger

Hides com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.logger.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.serialVersionUID.

TO_STRING_IGNORE_PROPSback to summary
pack-priv static final Set<E> TO_STRING_IGNORE_PROPS
VERSIONback to summary
private static final short VERSION

Hides com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.VERSION.

wcpdsback to summary
pack-priv transient WrapperConnectionPoolDataSource wcpds

Constructor Detail

AbstractComboPooledDataSourceback to summary
public AbstractComboPooledDataSource()
AbstractComboPooledDataSourceback to summary
public AbstractComboPooledDataSource(boolean autoregister)
AbstractComboPooledDataSourceback to summary
public AbstractComboPooledDataSource(String configName)

Method Detail

diffback to summary
private static boolean diff(int a, int b)
diffback to summary
private static boolean diff(boolean a, boolean b)
diffback to summary
private static boolean diff(Object a, Object b)
getAcquireIncrementback to summary
public int getAcquireIncrement()
getAcquireRetryAttemptsback to summary
public int getAcquireRetryAttempts()
getAcquireRetryDelayback to summary
public int getAcquireRetryDelay()
getAutomaticTestTableback to summary
public String getAutomaticTestTable()
getCheckoutTimeoutback to summary
public int getCheckoutTimeout()
getConnectionCustomizerClassNameback to summary
public String getConnectionCustomizerClassName()
getConnectionIsValidTimeoutback to summary
public int getConnectionIsValidTimeout()
getConnectionTesterClassNameback to summary
public String getConnectionTesterClassName()
getContextClassLoaderSourceback to summary
public String getContextClassLoaderSource()
getDescriptionback to summary
public String getDescription()
getDriverClassback to summary
public String getDriverClass()
getFactoryClassLocationback to summary
public String getFactoryClassLocation()

Overrides com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase.getFactoryClassLocation.

getIdleConnectionTestPeriodback to summary
public int getIdleConnectionTestPeriod()
getInitialPoolSizeback to summary
public int getInitialPoolSize()
getJdbcUrlback to summary
public String getJdbcUrl()
getMarkSessionBoundariesback to summary
public String getMarkSessionBoundaries()
getMaxAdministrativeTaskTimeback to summary
public int getMaxAdministrativeTaskTime()
getMaxConnectionAgeback to summary
public int getMaxConnectionAge()
getMaxIdleTimeback to summary
public int getMaxIdleTime()
getMaxIdleTimeExcessConnectionsback to summary
public int getMaxIdleTimeExcessConnections()
getMaxPoolSizeback to summary
public int getMaxPoolSize()
getMaxStatementsback to summary
public int getMaxStatements()
getMaxStatementsPerConnectionback to summary
public int getMaxStatementsPerConnection()
getMinPoolSizeback to summary
public int getMinPoolSize()
getOverrideDefaultPasswordback to summary
public String getOverrideDefaultPassword()
getOverrideDefaultUserback to summary
public String getOverrideDefaultUser()
getPasswordback to summary
public String getPassword()
getPreferredTestQueryback to summary
public String getPreferredTestQuery()
getPropertiesback to summary
public Properties getProperties()
getPropertyCycleback to summary
public int getPropertyCycle()
getStatementCacheNumDeferredCloseThreadsback to summary
public int getStatementCacheNumDeferredCloseThreads()
getTaskRunnerFactoryClassNameback to summary
public String getTaskRunnerFactoryClassName()
getUnreturnedConnectionTimeoutback to summary
public int getUnreturnedConnectionTimeout()
getUserback to summary
public String getUser()
getUserOverridesback to summary
public Map<K, V> getUserOverrides()
getUserOverridesAsStringback to summary
public String getUserOverridesAsString()
isAttemptResurrectOnCheckinback to summary
public boolean isAttemptResurrectOnCheckin()
isAutoCommitOnCloseback to summary
public boolean isAutoCommitOnClose()
isBreakAfterAcquireFailureback to summary
public boolean isBreakAfterAcquireFailure()
isDebugUnreturnedConnectionStackTracesback to summary
public boolean isDebugUnreturnedConnectionStackTraces()
isForceIgnoreUnresolvedTransactionsback to summary
public boolean isForceIgnoreUnresolvedTransactions()
isForceSynchronousCheckinsback to summary
public boolean isForceSynchronousCheckins()
isForceUseNamedDriverClassback to summary
public boolean isForceUseNamedDriverClass()
isPrivilegeSpawnedThreadsback to summary
public boolean isPrivilegeSpawnedThreads()
isTestConnectionOnCheckinback to summary
public boolean isTestConnectionOnCheckin()
isTestConnectionOnCheckoutback to summary
public boolean isTestConnectionOnCheckout()
isWrapperForback to summary
public boolean isWrapperFor(Class<?> iface) throws SQLException

Overrides com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.isWrapperFor.

Implements java.sql.Wrapper.isWrapperFor.

Doc from java.sql.Wrapper.isWrapperFor.

Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. Returns false otherwise. If this implements the interface then return true, else if this is a wrapper then return the result of recursively calling isWrapperFor on the wrapped object. If this does not implement the interface and is not a wrapper, return false. This method should be implemented as a low-cost operation compared to unwrap so that callers can use this method to avoid expensive unwrap calls that may fail. If this method returns true then calling unwrap with the same argument should succeed.

Parameters
iface:Class<?>

a Class defining an interface.

Returns:boolean

true if this implements the interface or directly or indirectly wraps an object that does.

Exceptions
SQLException:
if an error occurs while determining whether this is a wrapper for an object with the given interface.
isWrapperForDmdsback to summary
private boolean isWrapperForDmds(Class<?> iface) throws SQLException
readObjectback to summary
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException

Hides com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.readObject.

setAcquireIncrementback to summary
public void setAcquireIncrement(int acquireIncrement)
setAcquireRetryAttemptsback to summary
public void setAcquireRetryAttempts(int acquireRetryAttempts)
setAcquireRetryDelayback to summary
public void setAcquireRetryDelay(int acquireRetryDelay)
setAttemptResurrectOnCheckinback to summary
public void setAttemptResurrectOnCheckin(boolean attemptResurrectOnCheckin)
setAutoCommitOnCloseback to summary
public void setAutoCommitOnClose(boolean autoCommitOnClose)
setAutomaticTestTableback to summary
public void setAutomaticTestTable(String automaticTestTable)
setBreakAfterAcquireFailureback to summary
public void setBreakAfterAcquireFailure(boolean breakAfterAcquireFailure)
setCheckoutTimeoutback to summary
public void setCheckoutTimeout(int checkoutTimeout)
setConnectionCustomizerClassNameback to summary
public void setConnectionCustomizerClassName(String connectionCustomizerClassName)
setConnectionIsValidTimeoutback to summary
public void setConnectionIsValidTimeout(int connectionIsValidTimeout)
setConnectionTesterClassNameback to summary
public void setConnectionTesterClassName(String connectionTesterClassName) throws PropertyVetoException
setContextClassLoaderSourceback to summary
public void setContextClassLoaderSource(String contextClassLoaderSource) throws PropertyVetoException
setDebugUnreturnedConnectionStackTracesback to summary
public void setDebugUnreturnedConnectionStackTraces(boolean debugUnreturnedConnectionStackTraces)
setDescriptionback to summary
public void setDescription(String description)
setDriverClassback to summary
public void setDriverClass(String driverClass) throws PropertyVetoException
setFactoryClassLocationback to summary
public void setFactoryClassLocation(String factoryClassLocation)

Overrides com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase.setFactoryClassLocation.

setForceIgnoreUnresolvedTransactionsback to summary
public void setForceIgnoreUnresolvedTransactions(boolean forceIgnoreUnresolvedTransactions)
setForceSynchronousCheckinsback to summary
public void setForceSynchronousCheckins(boolean forceSynchronousCheckins)
setForceUseNamedDriverClassback to summary
public void setForceUseNamedDriverClass(boolean forceUseNamedDriverClass)
setIdleConnectionTestPeriodback to summary
public void setIdleConnectionTestPeriod(int idleConnectionTestPeriod)
setInitialPoolSizeback to summary
public void setInitialPoolSize(int initialPoolSize)
setJdbcUrlback to summary
public void setJdbcUrl(String jdbcUrl)
setMarkSessionBoundariesback to summary
public void setMarkSessionBoundaries(String markSessionBoundaries) throws PropertyVetoException
setMaxAdministrativeTaskTimeback to summary
public void setMaxAdministrativeTaskTime(int maxAdministrativeTaskTime)
setMaxConnectionAgeback to summary
public void setMaxConnectionAge(int maxConnectionAge)
setMaxIdleTimeback to summary
public void setMaxIdleTime(int maxIdleTime)
setMaxIdleTimeExcessConnectionsback to summary
public void setMaxIdleTimeExcessConnections(int maxIdleTimeExcessConnections)
setMaxPoolSizeback to summary
public void setMaxPoolSize(int maxPoolSize)
setMaxStatementsback to summary
public void setMaxStatements(int maxStatements)
setMaxStatementsPerConnectionback to summary
public void setMaxStatementsPerConnection(int maxStatementsPerConnection)
setMinPoolSizeback to summary
public void setMinPoolSize(int minPoolSize)
setOverrideDefaultPasswordback to summary
public void setOverrideDefaultPassword(String overrideDefaultPassword)
setOverrideDefaultUserback to summary
public void setOverrideDefaultUser(String overrideDefaultUser)
setPasswordback to summary
public void setPassword(String password)
setPreferredTestQueryback to summary
public void setPreferredTestQuery(String preferredTestQuery)
setPrivilegeSpawnedThreadsback to summary
public void setPrivilegeSpawnedThreads(boolean privilegeSpawnedThreads)
setPropertiesback to summary
public void setProperties(Properties properties)
setPropertyCycleback to summary
public void setPropertyCycle(int propertyCycle)
setStatementCacheNumDeferredCloseThreadsback to summary
public void setStatementCacheNumDeferredCloseThreads(int statementCacheNumDeferredCloseThreads)
setTaskRunnerFactoryClassNameback to summary
public void setTaskRunnerFactoryClassName(String taskRunnerFactoryClassName) throws PropertyVetoException
setTestConnectionOnCheckinback to summary
public void setTestConnectionOnCheckin(boolean testConnectionOnCheckin)
setTestConnectionOnCheckoutback to summary
public void setTestConnectionOnCheckout(boolean testConnectionOnCheckout)
setUnreturnedConnectionTimeoutback to summary
public void setUnreturnedConnectionTimeout(int unreturnedConnectionTimeout)
setUpPropertyEventsback to summary
private void setUpPropertyEvents()

Hides com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.setUpPropertyEvents.

setUserback to summary
public void setUser(String user)
setUserOverridesAsStringback to summary
public void setUserOverridesAsString(String uoas) throws PropertyVetoException
toStringback to summary
public String toString()

Overrides com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

toStringback to summary
public String toString(boolean show_config)

Implements abstract com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.toString.

unwrapback to summary
public <T> T unwrap(Class<T> iface) throws SQLException

Overrides com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.unwrap.

Implements java.sql.Wrapper.unwrap.

Doc from java.sql.Wrapper.unwrap.

Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. If the receiver implements the interface then the result is the receiver or a proxy for the receiver. If the receiver is a wrapper and the wrapped object implements the interface then the result is the wrapped object or a proxy for the wrapped object. Otherwise return the the result of calling unwrap recursively on the wrapped object or a proxy for that result. If the receiver is not a wrapper and does not implement the interface, then an SQLException is thrown.

Parameters
<T>
the type of the class modeled by this Class object
iface:Class<T>

A Class defining an interface that the result must implement.

Returns:T

an object that implements the interface. May be a proxy for the actual implementing object.

Exceptions
SQLException:
If no object found that implements the interface
updateLocalVarsFromCpdsPropback to summary
private void updateLocalVarsFromCpdsProp()
writeObjectback to summary
private void writeObject(ObjectOutputStream oos) throws IOException

Hides com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.writeObject.