C
- The kind of Connection
to manage.java.lang.AutoCloseable
, java.sql.Wrapper
, javax.sql.CommonDataSource
, javax.sql.DataSource
public class ManagedDataSource<C extends java.sql.Connection> extends PoolingDataSource<C>
Constructor | Description |
---|---|
ManagedDataSource(ObjectPool<C> pool,
TransactionRegistry transactionRegistry) |
Creates a ManagedDataSource which obtains connections from the specified pool and manages them using the
specified transaction registry.
|
Modifier and Type | Method | Description |
---|---|---|
java.sql.Connection |
getConnection() |
Returns a
Connection from my pool, according to the contract specified by
ObjectPool.borrowObject() . |
void |
setTransactionRegistry(TransactionRegistry transactionRegistry) |
Sets the transaction registry from the XAConnectionFactory used to create the pool.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getConnection, getLoginTimeout, getLogWriter, getParentLogger, getPool, isAccessToUnderlyingConnectionAllowed, isWrapperFor, setAccessToUnderlyingConnectionAllowed, setLoginTimeout, setLogWriter, unwrap
public 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 void setTransactionRegistry(TransactionRegistry transactionRegistry)
transactionRegistry
- the transaction registry acquired from the XAConnectionFactory used to create the poolpublic java.sql.Connection getConnection() throws java.sql.SQLException
PoolingDataSource
Connection
from my pool, according to the contract specified by
ObjectPool.borrowObject()
.getConnection
in interface javax.sql.DataSource
getConnection
in class PoolingDataSource<C extends java.sql.Connection>
java.sql.SQLException
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.