|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mchange.v2.c3p0.impl.IdentityTokenResolvable
com.mchange.v2.c3p0.ComboPooledDataSource
public final class ComboPooledDataSource
For the meaning of most of these properties, please see PoolConfig
!
Constructor Summary | |
---|---|
ComboPooledDataSource()
|
Method Summary | |
---|---|
void |
close()
C3P0 pooled DataSources use no resources before they are actually used in a VM, and they close themselves in their finalize() method. |
void |
close(boolean force_destroy)
Should be used only with great caution. |
int |
getAcquireIncrement()
|
int |
getAcquireRetryAttempts()
|
int |
getAcquireRetryDelay()
|
java.lang.String |
getAutomaticTestTable()
|
int |
getCheckoutTimeout()
|
java.sql.Connection |
getConnection()
|
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password)
|
java.lang.String |
getConnectionTesterClassName()
|
java.lang.String |
getDescription()
|
java.lang.String |
getDriverClass()
|
java.lang.String |
getFactoryClassLocation()
|
java.lang.String |
getIdentityToken()
|
int |
getIdleConnectionTestPeriod()
|
int |
getInitialPoolSize()
|
java.lang.String |
getJdbcUrl()
|
int |
getLoginTimeout()
|
java.io.PrintWriter |
getLogWriter()
|
int |
getMaxIdleTime()
|
int |
getMaxPoolSize()
|
int |
getMaxStatements()
|
int |
getMaxStatementsPerConnection()
|
int |
getMinPoolSize()
|
int |
getNumBusyConnections()
|
int |
getNumBusyConnections(java.lang.String username,
java.lang.String password)
|
int |
getNumBusyConnectionsAllUsers()
|
int |
getNumBusyConnectionsDefaultUser()
|
int |
getNumConnections()
|
int |
getNumConnections(java.lang.String username,
java.lang.String password)
|
int |
getNumConnectionsAllUsers()
|
int |
getNumConnectionsDefaultUser()
|
int |
getNumHelperThreads()
|
int |
getNumIdleConnections()
|
int |
getNumIdleConnections(java.lang.String username,
java.lang.String password)
|
int |
getNumIdleConnectionsAllUsers()
|
int |
getNumIdleConnectionsDefaultUser()
|
int |
getNumUnclosedOrphanedConnections()
|
int |
getNumUnclosedOrphanedConnections(java.lang.String username,
java.lang.String password)
|
int |
getNumUnclosedOrphanedConnectionsAllUsers()
|
int |
getNumUnclosedOrphanedConnectionsDefaultUser()
|
int |
getNumUserPools()
|
java.lang.String |
getPassword()
|
java.lang.String |
getPreferredTestQuery()
|
java.util.Properties |
getProperties()
|
int |
getPropertyCycle()
|
javax.naming.Reference |
getReference()
|
java.lang.String |
getUser()
|
void |
hardReset()
Destroys all pooled and checked-out Connections associated with this DataSource immediately. |
boolean |
isAutoCommitOnClose()
|
boolean |
isBreakAfterAcquireFailure()
|
boolean |
isForceIgnoreUnresolvedTransactions()
|
boolean |
isTestConnectionOnCheckin()
|
boolean |
isTestConnectionOnCheckout()
|
boolean |
isUsesTraditionalReflectiveProxies()
|
void |
setAcquireIncrement(int acquireIncrement)
|
void |
setAcquireRetryAttempts(int acquireRetryAttempts)
|
void |
setAcquireRetryDelay(int acquireRetryDelay)
|
void |
setAutoCommitOnClose(boolean autoCommitOnClose)
|
void |
setAutomaticTestTable(java.lang.String automaticTestTable)
|
void |
setBreakAfterAcquireFailure(boolean breakAfterAcquireFailure)
|
void |
setCheckoutTimeout(int checkoutTimeout)
|
void |
setConnectionTesterClassName(java.lang.String connectionTesterClassName)
|
void |
setDescription(java.lang.String description)
|
void |
setDriverClass(java.lang.String driverClass)
|
void |
setFactoryClassLocation(java.lang.String factoryClassLocation)
|
void |
setForceIgnoreUnresolvedTransactions(boolean forceIgnoreUnresolvedTransactions)
|
void |
setIdentityToken(java.lang.String identityToken)
|
void |
setIdleConnectionTestPeriod(int idleConnectionTestPeriod)
|
void |
setInitialPoolSize(int initialPoolSize)
|
void |
setJdbcUrl(java.lang.String jdbcUrl)
|
void |
setLoginTimeout(int seconds)
|
void |
setLogWriter(java.io.PrintWriter out)
|
void |
setMaxIdleTime(int maxIdleTime)
|
void |
setMaxPoolSize(int maxPoolSize)
|
void |
setMaxStatements(int maxStatements)
|
void |
setMaxStatementsPerConnection(int maxStatementsPerConnection)
|
void |
setMinPoolSize(int minPoolSize)
|
void |
setNumHelperThreads(int numHelperThreads)
|
void |
setPassword(java.lang.String password)
|
void |
setPreferredTestQuery(java.lang.String preferredTestQuery)
|
void |
setProperties(java.util.Properties properties)
|
void |
setPropertyCycle(int propertyCycle)
|
void |
setTestConnectionOnCheckin(boolean testConnectionOnCheckin)
|
void |
setTestConnectionOnCheckout(boolean testConnectionOnCheckout)
|
void |
setUser(java.lang.String user)
|
void |
setUsesTraditionalReflectiveProxies(boolean usesTraditionalReflectiveProxies)
|
void |
softReset(java.lang.String username,
java.lang.String password)
Discards all Connections managed by the PooledDataSource with the specified authentication credentials and reacquires new Connections to populate. |
void |
softResetAllUsers()
Discards all Connections managed by the PooledDataSource and reacquires new Connections to populate. |
void |
softResetDefaultUser()
Discards all Connections managed by the PooledDataSource's default-authentication pool and reacquires new Connections to populate. |
java.lang.String |
toString()
|
Methods inherited from class com.mchange.v2.c3p0.impl.IdentityTokenResolvable |
---|
doResolve, readResolve, verifyResolve |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ComboPooledDataSource()
Method Detail |
---|
public java.lang.String getDescription()
public void setDescription(java.lang.String description)
public java.lang.String getDriverClass()
public void setDriverClass(java.lang.String driverClass) throws java.beans.PropertyVetoException
java.beans.PropertyVetoException
public java.lang.String getJdbcUrl()
public void setJdbcUrl(java.lang.String jdbcUrl)
public java.util.Properties getProperties()
public void setProperties(java.util.Properties properties)
public java.lang.String getUser()
public void setUser(java.lang.String user)
public java.lang.String getPassword()
public void setPassword(java.lang.String password)
public int getCheckoutTimeout()
public void setCheckoutTimeout(int checkoutTimeout)
public int getAcquireIncrement()
public void setAcquireIncrement(int acquireIncrement)
public int getAcquireRetryAttempts()
public void setAcquireRetryAttempts(int acquireRetryAttempts)
public int getAcquireRetryDelay()
public void setAcquireRetryDelay(int acquireRetryDelay)
public boolean isAutoCommitOnClose()
public void setAutoCommitOnClose(boolean autoCommitOnClose)
public java.lang.String getConnectionTesterClassName()
public void setConnectionTesterClassName(java.lang.String connectionTesterClassName) throws java.beans.PropertyVetoException
java.beans.PropertyVetoException
public java.lang.String getAutomaticTestTable()
public void setAutomaticTestTable(java.lang.String automaticTestTable)
public boolean isForceIgnoreUnresolvedTransactions()
public void setForceIgnoreUnresolvedTransactions(boolean forceIgnoreUnresolvedTransactions)
public int getIdleConnectionTestPeriod()
public void setIdleConnectionTestPeriod(int idleConnectionTestPeriod)
public int getInitialPoolSize()
public void setInitialPoolSize(int initialPoolSize)
public int getMaxIdleTime()
public void setMaxIdleTime(int maxIdleTime)
public int getMaxPoolSize()
public void setMaxPoolSize(int maxPoolSize)
public int getMaxStatements()
public void setMaxStatements(int maxStatements)
public int getMaxStatementsPerConnection()
public void setMaxStatementsPerConnection(int maxStatementsPerConnection)
public int getMinPoolSize()
public void setMinPoolSize(int minPoolSize)
public int getPropertyCycle()
public void setPropertyCycle(int propertyCycle)
public boolean isBreakAfterAcquireFailure()
public void setBreakAfterAcquireFailure(boolean breakAfterAcquireFailure)
public boolean isTestConnectionOnCheckout()
public void setTestConnectionOnCheckout(boolean testConnectionOnCheckout)
public boolean isTestConnectionOnCheckin()
public void setTestConnectionOnCheckin(boolean testConnectionOnCheckin)
public boolean isUsesTraditionalReflectiveProxies()
public void setUsesTraditionalReflectiveProxies(boolean usesTraditionalReflectiveProxies)
public java.lang.String getPreferredTestQuery()
public void setPreferredTestQuery(java.lang.String preferredTestQuery)
public int getNumHelperThreads()
public void setNumHelperThreads(int numHelperThreads)
public java.lang.String getIdentityToken()
getIdentityToken
in interface com.mchange.v2.c3p0.impl.IdentityTokenized
public void setIdentityToken(java.lang.String identityToken)
setIdentityToken
in interface com.mchange.v2.c3p0.impl.IdentityTokenized
public java.lang.String getFactoryClassLocation()
public void setFactoryClassLocation(java.lang.String factoryClassLocation)
public javax.naming.Reference getReference() throws javax.naming.NamingException
getReference
in interface javax.naming.Referenceable
javax.naming.NamingException
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public java.io.PrintWriter getLogWriter() throws java.sql.SQLException
getLogWriter
in interface javax.sql.DataSource
java.sql.SQLException
public void setLogWriter(java.io.PrintWriter out) throws java.sql.SQLException
setLogWriter
in interface javax.sql.DataSource
java.sql.SQLException
public int getLoginTimeout() throws java.sql.SQLException
getLoginTimeout
in interface javax.sql.DataSource
java.sql.SQLException
public void setLoginTimeout(int seconds) throws java.sql.SQLException
setLoginTimeout
in interface javax.sql.DataSource
java.sql.SQLException
public int getNumConnections() throws java.sql.SQLException
getNumConnections
in interface PooledDataSource
java.sql.SQLException
public int getNumIdleConnections() throws java.sql.SQLException
getNumIdleConnections
in interface PooledDataSource
java.sql.SQLException
public int getNumBusyConnections() throws java.sql.SQLException
getNumBusyConnections
in interface PooledDataSource
java.sql.SQLException
public int getNumUnclosedOrphanedConnections() throws java.sql.SQLException
getNumUnclosedOrphanedConnections
in interface PooledDataSource
java.sql.SQLException
public int getNumConnectionsDefaultUser() throws java.sql.SQLException
getNumConnectionsDefaultUser
in interface PooledDataSource
java.sql.SQLException
public int getNumIdleConnectionsDefaultUser() throws java.sql.SQLException
getNumIdleConnectionsDefaultUser
in interface PooledDataSource
java.sql.SQLException
public int getNumBusyConnectionsDefaultUser() throws java.sql.SQLException
getNumBusyConnectionsDefaultUser
in interface PooledDataSource
java.sql.SQLException
public int getNumUnclosedOrphanedConnectionsDefaultUser() throws java.sql.SQLException
getNumUnclosedOrphanedConnectionsDefaultUser
in interface PooledDataSource
java.sql.SQLException
public void softResetDefaultUser() throws java.sql.SQLException
PooledDataSource
softResetDefaultUser
in interface PooledDataSource
java.sql.SQLException
public int getNumConnections(java.lang.String username, java.lang.String password) throws java.sql.SQLException
getNumConnections
in interface PooledDataSource
java.sql.SQLException
public int getNumIdleConnections(java.lang.String username, java.lang.String password) throws java.sql.SQLException
getNumIdleConnections
in interface PooledDataSource
java.sql.SQLException
public int getNumBusyConnections(java.lang.String username, java.lang.String password) throws java.sql.SQLException
getNumBusyConnections
in interface PooledDataSource
java.sql.SQLException
public int getNumUnclosedOrphanedConnections(java.lang.String username, java.lang.String password) throws java.sql.SQLException
getNumUnclosedOrphanedConnections
in interface PooledDataSource
java.sql.SQLException
public void softReset(java.lang.String username, java.lang.String password) throws java.sql.SQLException
PooledDataSource
softReset
in interface PooledDataSource
java.sql.SQLException
public int getNumBusyConnectionsAllUsers() throws java.sql.SQLException
getNumBusyConnectionsAllUsers
in interface PooledDataSource
java.sql.SQLException
public int getNumIdleConnectionsAllUsers() throws java.sql.SQLException
getNumIdleConnectionsAllUsers
in interface PooledDataSource
java.sql.SQLException
public int getNumConnectionsAllUsers() throws java.sql.SQLException
getNumConnectionsAllUsers
in interface PooledDataSource
java.sql.SQLException
public int getNumUnclosedOrphanedConnectionsAllUsers() throws java.sql.SQLException
getNumUnclosedOrphanedConnectionsAllUsers
in interface PooledDataSource
java.sql.SQLException
public void softResetAllUsers() throws java.sql.SQLException
PooledDataSource
softResetAllUsers
in interface PooledDataSource
java.sql.SQLException
public int getNumUserPools() throws java.sql.SQLException
getNumUserPools
in interface PooledDataSource
java.sql.SQLException
public void hardReset() throws java.sql.SQLException
PooledDataSource
hardReset
in interface PooledDataSource
java.sql.SQLException
public void close() throws java.sql.SQLException
PooledDataSource
C3P0 pooled DataSources use no resources before they are actually used in a VM, and they close themselves in their finalize() method. When they are active and pooling, they may have open database connections and their pool may spawn several threads for its maintenance. You can use this method to clean these resource methods up quickly when you will no longer be using this DataSource. The resources will actually be cleaned up only if no other DataSources are sharing the same pool.
You can equivalently use the static method destroy() in the DataSources class to clean-up these resources.
This is equivalent to calling close( false ).
close
in interface PooledDataSource
java.sql.SQLException
DataSources.destroy(javax.sql.DataSource)
public void close(boolean force_destroy) throws java.sql.SQLException
PooledDataSource
Should be used only with great caution. If force_destroy is set to true, this immediately destroys any pool and cleans up all resources this DataSource may be using, even if other DataSources are sharing that pool! In general, it is difficult to know whether a pool is being shared by multiple DataSources. It may depend upon whether or not a JNDI implementation returns a single instance or multiple copies upon lookup (which is undefined by the JNDI spec).
In general, this method should be used only when you wish to wind down all c3p0 pools in a ClassLoader. For example, when shutting down and restarting a web application that uses c3p0, you may wish to kill all threads making use of classes loaded by a web-app specific ClassLoader, so that the ClassLoader can be cleanly garbage collected. In this case, you may wish to use force destroy. Otherwise, it is much safer to use the simple destroy() method, which will not shut down pools that may still be in use.
To close a pool normally, use the no argument close method, or set force_destroy to false.
close
in interface PooledDataSource
java.sql.SQLException
PooledDataSource.close()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |