Skip navigation links

Oracle® Universal Connection Pool for JDBC Java API Reference
11g Release 2 (11.2)

E12826-02


oracle.ucp.jdbc
Class PoolXADataSourceImpl

java.lang.Object
  extended by oracle.ucp.jdbc.PoolDataSourceImpl
      extended by oracle.ucp.jdbc.PoolXADataSourceImpl

All Implemented Interfaces:
java.io.Serializable, javax.naming.Referenceable, javax.naming.spi.ObjectFactory, javax.sql.DataSource, javax.sql.XADataSource, PoolDataSource, PoolXADataSource, UniversalConnectionPoolAdapter

public class PoolXADataSourceImpl
extends PoolDataSourceImpl
implements PoolXADataSource, java.io.Serializable, javax.naming.Referenceable, javax.naming.spi.ObjectFactory, UniversalConnectionPoolAdapter

A connection pool-aware data source. This DataSource uses the Universal Connection Pool to get an XAconneciton, creating a proxy to that connection, and returning the proxy to the client. When the client calls close on the XAConnection proxy, the underlying physical connection is usually returned to the pool. Also see the proxy factory. <p/> Besides other data source properties, applications must set the connection factory class name. The connection factory class is a class that implements javax.sql.XADataSource and does not implement its own connection pooling. The connection factory's getXAConnection(...) methods should return a physical XAConnection to the database. For example, "oracle.jdbc.xa.client.OracleXADataSource" is a valid connection factory class name.

See Also:
Serialized Form

Field Summary

 

Fields inherited from class oracle.ucp.jdbc.PoolDataSourceImpl
m_connectionFactory, m_connectionFactoryClassName, m_cp

 

Fields inherited from interface oracle.ucp.jdbc.PoolDataSource
UCP_ABANDONED_CONNECTION_TIMEOUT, UCP_CONNECTION_FACTORY_CLASS_NAME, UCP_CONNECTION_FACTORY_PROPERTIES, UCP_CONNECTION_HARVEST_MAX_COUNT, UCP_CONNECTION_HARVEST_TRIGGER_COUNT, UCP_CONNECTION_POOL_NAME, UCP_CONNECTION_PROPERTIES, UCP_CONNECTION_WAIT_TIMEOUT, UCP_DATA_SOURCE_NAME, UCP_DATABASE_NAME, UCP_DESCRIPTION, UCP_FAST_CONNECTION_FAILOVER_ENABLED, UCP_INACTIVE_CONNECTION_TIMEOUT, UCP_INITIAL_POOL_SIZE, UCP_MAX_CONNECTION_REUSE_COUNT, UCP_MAX_CONNECTION_REUSE_TIME, UCP_MAX_IDLE_TIME, UCP_MAX_POOL_SIZE, UCP_MAX_STATEMENTS, UCP_MIN_POOL_SIZE, UCP_NETWORK_PROTOCOL, UCP_ONS_CONFIGURATION, UCP_PASSWORD, UCP_PORT_NUMBER, UCP_PROPERTY_CYCLE, UCP_ROLE_NAME, UCP_SERVER_NAME, UCP_SQL_FOR_VALIDATE_CONNECTION, UCP_TIME_TO_LIVE_CONNECTION_TIMEOUT, UCP_TIMEOUT_CHECK_INTERVAL, UCP_URL, UCP_USER, UCP_VALIDATE_CONNECTION_ON_BORROW

 

Constructor Summary
PoolXADataSourceImpl()
           

 

Method Summary
protected  void createPoolWithDefaultProperties()
           
 java.sql.Connection getConnection()
           
 java.sql.Connection getConnection(java.util.Properties labels)
          Attempts to obtain a database connection with the requested connection labels.
 java.sql.Connection getConnection(java.lang.String username, java.lang.String password)
           
 java.sql.Connection getConnection(java.lang.String username, java.lang.String password, java.util.Properties labels)
          Attempts to obtain a database connection with the requested connection labels.
 javax.sql.XAConnection getXAConnection()
          Obtains an XAConnection from the embedded Universal Connection Pool instance.
 javax.sql.XAConnection getXAConnection(java.util.Properties labels)
          Obtains an XAConnection from the embedded Universal Connection Pool instance, using the given connection labels.
 javax.sql.XAConnection getXAConnection(java.lang.String user, java.lang.String password)
          Obtains an XAConnection from the embedded Universal Connection Pool instance, using the given user name and password.
 javax.sql.XAConnection getXAConnection(java.lang.String username, java.lang.String password, java.util.Properties labels)
          Obtains an XAConnection from the embedded Universal Connection Pool instance, using the given user name, password, and connection labels.

 

Methods inherited from class oracle.ucp.jdbc.PoolDataSourceImpl
createUniversalConnectionPool, createUniversalConnectionPoolMBean, getAbandonedConnectionTimeout, getAvailableConnectionsCount, getBorrowedConnectionsCount, getConnectionFactoryClassName, getConnectionFactoryProperties, getConnectionFactoryProperty, getConnectionHarvestMaxCount, getConnectionHarvestTriggerCount, getConnectionPoolName, getConnectionProperties, getConnectionProperty, getConnectionWaitTimeout, getDatabaseName, getDataSourceName, getDescription, getFastConnectionFailoverEnabled, getInactiveConnectionTimeout, getInitialPoolSize, getLoginTimeout, getLogWriter, getMaxConnectionReuseCount, getMaxConnectionReuseTime, getMaxIdleTime, getMaxPoolSize, getMaxStatements, getMinPoolSize, getNetworkProtocol, getObjectInstance, getONSConfiguration, getPassword, getPortNumber, getPropertyCycle, getReference, getRoleName, getServerName, getSQLForValidateConnection, getStatistics, getTimeoutCheckInterval, getTimeToLiveConnectionTimeout, getURL, getUser, getValidateConnectionOnBorrow, isWrapperFor, registerConnectionAffinityCallback, registerConnectionLabelingCallback, removeConnectionAffinityCallback, removeConnectionLabelingCallback, setAbandonedConnectionTimeout, setConnectionFactoryClassName, setConnectionFactoryProperties, setConnectionFactoryProperty, setConnectionHarvestMaxCount, setConnectionHarvestTriggerCount, setConnectionPoolName, setConnectionProperties, setConnectionProperty, setConnectionWaitTimeout, setDatabaseName, setDataSourceName, setDescription, setFastConnectionFailoverEnabled, setInactiveConnectionTimeout, setInitialPoolSize, setLoginTimeout, setLogWriter, setMaxConnectionReuseCount, setMaxConnectionReuseTime, setMaxIdleTime, setMaxPoolSize, setMaxStatements, setMinPoolSize, setNetworkProtocol, setONSConfiguration, setPassword, setPortNumber, setPropertyCycle, setRoleName, setServerName, setSQLForValidateConnection, setTimeoutCheckInterval, setTimeToLiveConnectionTimeout, setURL, setUser, setValidateConnectionOnBorrow, startPool, toBasicType, unwrap

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Methods inherited from interface oracle.ucp.jdbc.PoolDataSource
getAbandonedConnectionTimeout, getAvailableConnectionsCount, getBorrowedConnectionsCount, getConnectionFactoryClassName, getConnectionFactoryProperties, getConnectionFactoryProperty, getConnectionHarvestMaxCount, getConnectionHarvestTriggerCount, getConnectionPoolName, getConnectionProperties, getConnectionProperty, getConnectionWaitTimeout, getDatabaseName, getDataSourceName, getDescription, getFastConnectionFailoverEnabled, getInactiveConnectionTimeout, getInitialPoolSize, getMaxConnectionReuseCount, getMaxConnectionReuseTime, getMaxIdleTime, getMaxPoolSize, getMaxStatements, getMinPoolSize, getNetworkProtocol, getONSConfiguration, getPassword, getPortNumber, getPropertyCycle, getRoleName, getServerName, getSQLForValidateConnection, getStatistics, getTimeoutCheckInterval, getTimeToLiveConnectionTimeout, getURL, getUser, getValidateConnectionOnBorrow, registerConnectionAffinityCallback, registerConnectionLabelingCallback, removeConnectionAffinityCallback, removeConnectionLabelingCallback, setAbandonedConnectionTimeout, setConnectionFactoryClassName, setConnectionFactoryProperties, setConnectionFactoryProperty, setConnectionHarvestMaxCount, setConnectionHarvestTriggerCount, setConnectionPoolName, setConnectionProperties, setConnectionProperty, setConnectionWaitTimeout, setDatabaseName, setDataSourceName, setDescription, setFastConnectionFailoverEnabled, setInactiveConnectionTimeout, setInitialPoolSize, setMaxConnectionReuseCount, setMaxConnectionReuseTime, setMaxIdleTime, setMaxPoolSize, setMaxStatements, setMinPoolSize, setNetworkProtocol, setONSConfiguration, setPassword, setPortNumber, setPropertyCycle, setRoleName, setServerName, setSQLForValidateConnection, setTimeoutCheckInterval, setTimeToLiveConnectionTimeout, setURL, setUser, setValidateConnectionOnBorrow

 

Methods inherited from interface javax.sql.DataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter

 

Methods inherited from interface javax.sql.XADataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter

 

Methods inherited from interface javax.naming.Referenceable
getReference

 

Methods inherited from interface javax.naming.spi.ObjectFactory
getObjectInstance

 

Methods inherited from interface oracle.ucp.UniversalConnectionPoolAdapter
createUniversalConnectionPool, createUniversalConnectionPoolMBean

 

Constructor Detail

PoolXADataSourceImpl

public PoolXADataSourceImpl()

Method Detail

createPoolWithDefaultProperties

protected void createPoolWithDefaultProperties()
                                        throws java.sql.SQLException
Overrides:
createPoolWithDefaultProperties in class PoolDataSourceImpl
Throws:
java.sql.SQLException

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Specified by:
getConnection in interface javax.sql.DataSource
Overrides:
getConnection in class PoolDataSourceImpl
Throws:
java.sql.SQLException

getConnection

public java.sql.Connection getConnection(java.lang.String username,
                                         java.lang.String password)
                                  throws java.sql.SQLException
Specified by:
getConnection in interface javax.sql.DataSource
Overrides:
getConnection in class PoolDataSourceImpl
Throws:
java.sql.SQLException

getConnection

public java.sql.Connection getConnection(java.util.Properties labels)
                                  throws java.sql.SQLException
Description copied from class: PoolDataSourceImpl
Attempts to obtain a database connection with the requested connection labels.
Specified by:
getConnection in interface PoolDataSource
Overrides:
getConnection in class PoolDataSourceImpl
Parameters:
labels - The requested connection labels.
Returns:
A Connection to the database.
Throws:
java.sql.SQLException - if a database-access error occurs.

getConnection

public java.sql.Connection getConnection(java.lang.String username,
                                         java.lang.String password,
                                         java.util.Properties labels)
                                  throws java.sql.SQLException
Description copied from class: PoolDataSourceImpl
Attempts to obtain a database connection with the requested connection labels.
Specified by:
getConnection in interface PoolDataSource
Overrides:
getConnection in class PoolDataSourceImpl
Parameters:
username - The database user on whose behalf the connection is being made.
password - The user's password.
labels - The requested connection labels.
Returns:
A Connection to the database.
Throws:
java.sql.SQLException - if a database-access error occurs.

getXAConnection

public javax.sql.XAConnection getXAConnection()
                                       throws java.sql.SQLException
Obtains an XAConnection from the embedded Universal Connection Pool instance. Each XAConnection represents a physical database connection can be used in a distributed transaction.
Specified by:
getXAConnection in interface javax.sql.XADataSource
Specified by:
getXAConnection in interface PoolXADataSource
Returns:
an XAConnection object, which represents a physical connection to a data source, that can be used in a distributed transaction
Throws:
java.sql.SQLException - if a database access error occurs

getXAConnection

public javax.sql.XAConnection getXAConnection(java.lang.String user,
                                              java.lang.String password)
                                       throws java.sql.SQLException
Obtains an XAConnection from the embedded Universal Connection Pool instance, using the given user name and password. Each XAConnection represents a physical database connection can be used in a distributed transaction.
Specified by:
getXAConnection in interface javax.sql.XADataSource
Specified by:
getXAConnection in interface PoolXADataSource
Parameters:
user - The database user on whose behalf the connection is being made.
password - The user's password.
Returns:
an XAConnection object, which represents a physical connection to a data source, that can be used in a distributed transaction.
Throws:
java.sql.SQLException - if a database access error occurs.

getXAConnection

public javax.sql.XAConnection getXAConnection(java.util.Properties labels)
                                       throws java.sql.SQLException
Obtains an XAConnection from the embedded Universal Connection Pool instance, using the given connection labels. Each XAConnection represents a physical database connection can be used in a distributed transaction.
Specified by:
getXAConnection in interface PoolXADataSource
Parameters:
labels - The requested connection labels.
Returns:
an XAConnection object, which represents a physical connection to a data source, that can be used in a distributed transaction.
Throws:
java.sql.SQLException - if a database access error occurs.

getXAConnection

public javax.sql.XAConnection getXAConnection(java.lang.String username,
                                              java.lang.String password,
                                              java.util.Properties labels)
                                       throws java.sql.SQLException
Obtains an XAConnection from the embedded Universal Connection Pool instance, using the given user name, password, and connection labels. Each XAConnection represents a physical database connection can be used in a distributed transaction.
Specified by:
getXAConnection in interface PoolXADataSource
Parameters:
username - The database user on whose behalf the connection is being made.
password - The user's password.
labels - The requested connection labels.
Returns:
an XAConnection object, which represents a physical connection to a data source, that can be used in a distributed transaction.
Throws:
java.sql.SQLException - if a database access error occurs.

Skip navigation links

Oracle® Universal Connection Pool for JDBC Java API Reference
11g Release 2 (11.2)

E12826-02


Copyright © 2010, Oracle and/or its affiliates. All rights reserved.
ORACLE CONFIDENTIAL
For authorized use only.
Do not distribute to third parties.