C - The kind of Connection to manage.public class ManagedDataSource<C extends java.sql.Connection> extends PoolingDataSource<C>
| 构造器和说明 |
|---|
ManagedDataSource(ObjectPool<C> pool,
TransactionRegistry transactionRegistry)
Creates a ManagedDataSource which obtains connections from the specified pool and manages them using the
specified transaction registry.
|
| 限定符和类型 | 方法和说明 |
|---|---|
java.sql.Connection |
getConnection()
Returns a
Connection from my pool, according to the contract specified by
ObjectPool.borrowObject(). |
TransactionRegistry |
getTransactionRegistry()
Gets the transaction registry.
|
void |
setTransactionRegistry(TransactionRegistry transactionRegistry)
Sets the transaction registry from the XAConnectionFactory used to create the pool.
|
close, getConnection, getLoginTimeout, getLogWriter, getParentLogger, getPool, isAccessToUnderlyingConnectionAllowed, isWrapperFor, setAccessToUnderlyingConnectionAllowed, setLoginTimeout, setLogWriter, unwrappublic ManagedDataSource(ObjectPool<C> pool, TransactionRegistry transactionRegistry)
pool - the connection pooltransactionRegistry - the transaction registry obtained from the XAConnectionFactory used to create the connection pool
object factorypublic java.sql.Connection getConnection()
throws java.sql.SQLException
PoolingDataSourceConnection from my pool, according to the contract specified by
ObjectPool.borrowObject().getConnection 在接口中 javax.sql.DataSourcegetConnection 在类中 PoolingDataSource<C extends java.sql.Connection>java.sql.SQLExceptionpublic TransactionRegistry getTransactionRegistry()
setTransactionRegistry(TransactionRegistry)public void setTransactionRegistry(TransactionRegistry transactionRegistry)
transactionRegistry - the transaction registry acquired from the XAConnectionFactory used to create the pool