Top Fields Constructors Methods
com.mchange.v2.c3p0

public final Class WrapperConnectionPoolDataSource

extends WrapperConnectionPoolDataSourceBase
implements ConnectionPoolDataSource
Class Inheritance
All Implemented Interfaces
javax.sql.ConnectionPoolDataSource, javax.sql.CommonDataSource
Imports
java.beans.PropertyChangeEvent, .PropertyVetoException, .VetoableChangeListener, .PropertyChangeListener, java.io.PrintWriter, java.lang.reflect.Method, java.util.Map, java.sql.*, javax.sql.*, com.mchange.v2.c3p0.cfg.C3P0Config, .C3P0ConfigUtils, com.mchange.v2.c3p0.impl.*, com.mchange.v2.log.*, com.mchange.v1.db.sql.ConnectionUtils

Field Summary

Modifier and TypeField and Description
pack-priv static final MLogger
pack-priv Map<K, V>
Inherited from com.mchange.v2.c3p0.impl.WrapperConnectionPoolDataSourceBase:
pcsvcs

Constructor Summary

AccessConstructor and Description
public
WrapperConnectionPoolDataSource(boolean autoregister)

public
public

Method Summary

Modifier and TypeMethod and Description
protected synchronized String
private synchronized int
private synchronized String
public int
getLoginTimeout()

Implements javax.sql.ConnectionPoolDataSource.getLoginTimeout.

Gets the maximum time in seconds that this data source can wait while attempting to connect to a database.

public PrintWriter
getLogWriter()

Implements javax.sql.ConnectionPoolDataSource.getLogWriter.

Retrieves the log writer for this DataSource object.

public String
public PooledConnection
getPooledConnection()

Implements javax.sql.ConnectionPoolDataSource.getPooledConnection.

Attempts to establish a physical database connection that can be used as a pooled connection.

protected PooledConnection
public PooledConnection
getPooledConnection(String
the database user on whose behalf the connection is being made
user
,
String
the user's password
password
)

Implements javax.sql.ConnectionPoolDataSource.getPooledConnection.

Attempts to establish a physical database connection that can be used as a pooled connection.

protected PooledConnection
private synchronized String
public String
public synchronized Map<K, V>
private synchronized boolean
private synchronized boolean
public void
setLoginTimeout(int
the data source login time limit
seconds
)

Implements javax.sql.ConnectionPoolDataSource.setLoginTimeout.

Sets the maximum time in seconds that this data source will wait while attempting to connect to a database.

public void
setLogWriter(PrintWriter
the new log writer; to disable logging, set to null
out
)

Implements javax.sql.ConnectionPoolDataSource.setLogWriter.

Sets the log writer for this DataSource object to the given java.io.PrintWriter object.

private void
private synchronized void
setUserOverrides(Map<K, V> userOverrides)

public String
toString()

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

Returns a string representation of the object.

Inherited from com.mchange.v2.c3p0.impl.WrapperConnectionPoolDataSourceBase:
addPropertyChangeListeneraddPropertyChangeListeneraddVetoableChangeListenergetAcquireIncrementgetAcquireRetryAttemptsgetAcquireRetryDelaygetAutomaticTestTablegetCheckoutTimeoutgetConnectionCustomizerClassNamegetConnectionIsValidTimeoutgetConnectionTesterClassNamegetContextClassLoaderSourcegetFactoryClassLocationgetIdentityTokengetIdleConnectionTestPeriodgetInitialPoolSizegetMarkSessionBoundariesgetMaxAdministrativeTaskTimegetMaxConnectionAgegetMaxIdleTimegetMaxIdleTimeExcessConnectionsgetMaxPoolSizegetMaxStatementsgetMaxStatementsPerConnectiongetMinPoolSizegetNestedDataSourcegetOverrideDefaultPasswordgetOverrideDefaultUsergetParentLoggergetPreferredTestQuerygetPropertyChangeListenersgetPropertyChangeSupportgetPropertyCyclegetReferencegetStatementCacheNumDeferredCloseThreadsgetTaskRunnerFactoryClassNamegetUnreturnedConnectionTimeoutgetUserOverridesAsStringgetVetoableChangeListenersgetVetoableChangeSupportisAttemptResurrectOnCheckinisAutoCommitOnCloseisBreakAfterAcquireFailureisDebugUnreturnedConnectionStackTracesisForceIgnoreUnresolvedTransactionsisForceSynchronousCheckinsisPrivilegeSpawnedThreadsisTestConnectionOnCheckinisTestConnectionOnCheckoutremovePropertyChangeListenerremovePropertyChangeListenerremoveVetoableChangeListenersetAcquireIncrementsetAcquireRetryAttemptssetAcquireRetryDelaysetAttemptResurrectOnCheckinsetAutoCommitOnClosesetAutomaticTestTablesetBreakAfterAcquireFailuresetCheckoutTimeoutsetConnectionCustomizerClassNamesetConnectionIsValidTimeoutsetConnectionTesterClassNamesetContextClassLoaderSourcesetDebugUnreturnedConnectionStackTracessetFactoryClassLocationsetForceIgnoreUnresolvedTransactionssetForceSynchronousCheckinssetIdentityTokensetIdleConnectionTestPeriodsetInitialPoolSizesetMarkSessionBoundariessetMaxAdministrativeTaskTimesetMaxConnectionAgesetMaxIdleTimesetMaxIdleTimeExcessConnectionssetMaxPoolSizesetMaxStatementssetMaxStatementsPerConnectionsetMinPoolSizesetNestedDataSourcesetOverrideDefaultPasswordsetOverrideDefaultUsersetPreferredTestQuerysetPrivilegeSpawnedThreadssetPropertyCyclesetStatementCacheNumDeferredCloseThreadssetTaskRunnerFactoryClassNamesetTestConnectionOnCheckinsetTestConnectionOnCheckoutsetUnreturnedConnectionTimeoutsetUserOverridesAsString

Field Detail

loggerback to summary
pack-priv static final MLogger logger
userOverridesback to summary
pack-priv Map<K, V> userOverrides

Constructor Detail

WrapperConnectionPoolDataSourceback to summary
public WrapperConnectionPoolDataSource(boolean autoregister)
WrapperConnectionPoolDataSourceback to summary
public WrapperConnectionPoolDataSource()
WrapperConnectionPoolDataSourceback to summary
public WrapperConnectionPoolDataSource(String configName)

Method Detail

extraToStringInfoback to summary
protected synchronized String extraToStringInfo()

Overrides com.mchange.v2.c3p0.impl.WrapperConnectionPoolDataSourceBase.extraToStringInfo.

getConnectionIsValidTimeoutback to summary
private synchronized int getConnectionIsValidTimeout(String userName)
getConnectionTesterClassNameback to summary
private synchronized String getConnectionTesterClassName(String userName)
getLoginTimeoutback to summary
public int getLoginTimeout() throws SQLException

Implements javax.sql.ConnectionPoolDataSource.getLoginTimeout.

Doc from javax.sql.ConnectionPoolDataSource.getLoginTimeout.

Gets the maximum time in seconds that this data source can wait while attempting to connect to a database. A value of zero means that the timeout is the default system timeout if there is one; otherwise, it means that there is no timeout. When a DataSource object is created, the login timeout is initially zero.

Returns:int

Doc from javax.sql.CommonDataSource.getLoginTimeout.

the data source login time limit

Exceptions
SQLException:

Doc from javax.sql.CommonDataSource.getLoginTimeout.

if a database access error occurs.

getLogWriterback to summary
public PrintWriter getLogWriter() throws SQLException

Implements javax.sql.ConnectionPoolDataSource.getLogWriter.

Doc from javax.sql.ConnectionPoolDataSource.getLogWriter.

Retrieves the log writer for this DataSource object.

The log writer is a character output stream to which all logging and tracing messages for this data source will be printed. This includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so on. Messages printed to a data source specific log writer are not printed to the log writer associated with the java.sql.DriverManager class. When a DataSource object is created, the log writer is initially null; in other words, the default is for logging to be disabled.

Returns:PrintWriter

Doc from javax.sql.CommonDataSource.getLogWriter.

the log writer for this data source or null if logging is disabled

Exceptions
SQLException:

Doc from javax.sql.CommonDataSource.getLogWriter.

if a database access error occurs

getPasswordback to summary
public String getPassword()
getPooledConnectionback to summary
public PooledConnection getPooledConnection() throws SQLException

Implements javax.sql.ConnectionPoolDataSource.getPooledConnection.

Doc from javax.sql.ConnectionPoolDataSource.getPooledConnection.

Attempts to establish a physical database connection that can be used as a pooled connection.

Returns:PooledConnection

a PooledConnection object that is a physical connection to the database that this ConnectionPoolDataSource object represents

Exceptions
SQLException:
if a database access error occurs
getPooledConnectionback to summary
protected PooledConnection getPooledConnection(ConnectionCustomizer cc, String pdsIdt) throws SQLException

Implements abstract com.mchange.v2.c3p0.impl.WrapperConnectionPoolDataSourceBase.getPooledConnection.

getPooledConnectionback to summary
public PooledConnection getPooledConnection(String user, String password) throws SQLException

Implements javax.sql.ConnectionPoolDataSource.getPooledConnection.

Doc from javax.sql.ConnectionPoolDataSource.getPooledConnection.

Attempts to establish a physical database connection that can be used as a pooled connection.

Parameters
user:String

the database user on whose behalf the connection is being made

password:String

the user's password

Returns:PooledConnection

a PooledConnection object that is a physical connection to the database that this ConnectionPoolDataSource object represents

Exceptions
SQLException:
if a database access error occurs
getPooledConnectionback to summary
protected PooledConnection getPooledConnection(String user, String password, ConnectionCustomizer cc, String pdsIdt) throws SQLException

Implements abstract com.mchange.v2.c3p0.impl.WrapperConnectionPoolDataSourceBase.getPooledConnection.

getPreferredTestQueryback to summary
private synchronized String getPreferredTestQuery(String userName)
getUserback to summary
public String getUser()
getUserOverridesback to summary
public synchronized Map<K, V> getUserOverrides()
isAutoCommitOnCloseback to summary
private synchronized boolean isAutoCommitOnClose(String userName)
isForceIgnoreUnresolvedTransactionsback to summary
private synchronized boolean isForceIgnoreUnresolvedTransactions(String userName)
setLoginTimeoutback to summary
public void setLoginTimeout(int seconds) throws SQLException

Implements javax.sql.ConnectionPoolDataSource.setLoginTimeout.

Doc from javax.sql.ConnectionPoolDataSource.setLoginTimeout.

Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. A value of zero specifies that the timeout is the default system timeout if there is one; otherwise, it specifies that there is no timeout. When a DataSource object is created, the login timeout is initially zero.

Parameters
seconds:int

Doc from javax.sql.CommonDataSource.setLoginTimeout.

the data source login time limit

Exceptions
SQLException:

Doc from javax.sql.CommonDataSource.setLoginTimeout.

if a database access error occurs.

setLogWriterback to summary
public void setLogWriter(PrintWriter out) throws SQLException

Implements javax.sql.ConnectionPoolDataSource.setLogWriter.

Doc from javax.sql.ConnectionPoolDataSource.setLogWriter.

Sets the log writer for this DataSource object to the given java.io.PrintWriter object.

The log writer is a character output stream to which all logging and tracing messages for this data source will be printed. This includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so on. Messages printed to a data source- specific log writer are not printed to the log writer associated with the java.sql.DriverManager class. When a DataSource object is created the log writer is initially null; in other words, the default is for logging to be disabled.

Parameters
out:PrintWriter

Doc from javax.sql.CommonDataSource.setLogWriter.

the new log writer; to disable logging, set to null

Exceptions
SQLException:

Doc from javax.sql.CommonDataSource.setLogWriter.

if a database access error occurs

setUpPropertyListenersback to summary
private void setUpPropertyListeners()
setUserOverridesback to summary
private synchronized void setUserOverrides(Map<K, V> userOverrides)
toStringback to summary
public String toString()

Overrides com.mchange.v2.c3p0.impl.WrapperConnectionPoolDataSourceBase.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