Class OracleConnectionPoolDataSource
- java.lang.Object
-
- oracle.jdbc.datasource.impl.OracleDataSource
-
- oracle.jdbc.datasource.impl.OracleConnectionPoolDataSource
-
- All Implemented Interfaces:
Serializable,Wrapper,Referenceable,CommonDataSource,ConnectionPoolDataSource,DataSource,OracleCommonDataSource,OracleConnectionPoolDataSource,OracleDataSource,oracle.jdbc.internal.Monitor,oracle.jdbc.replay.internal.OracleConnectionPoolDataSource,oracle.jdbc.replay.internal.OracleDataSource,OracleConnectionPoolDataSource,OracleDataSource
- Direct Known Subclasses:
OracleConnectionPoolDataSource,OracleConnectionPoolDataSourceImpl
public class OracleConnectionPoolDataSource extends OracleDataSource implements OracleConnectionPoolDataSource, oracle.jdbc.replay.internal.OracleConnectionPoolDataSource
A
DataSourceobject is a factory forConnectionobjects. An object that implements theDataSourceinterface will typically be registered with a JNDI service provider. A JDBC driver that is accessed via theDataSourceAPI does not automatically register itself with theDriverManager.This data souce implements the standard JDBC
javax.sql.OracleConnectionPoolDataSourceand the Oracle JDBC extensionoracle.jdbc.datasource.OracleConnectionPoolDataSourceinterfaces.This data Source also supports Application Continuity (AC) and transparent JDBC operation replay upon a failover. To disable such feature, set
"oracle.jdbc.enableACSupport"to false either as a Java system property, or as a connection property on this data source.The following example illustrates the use of this data source to create a JDBC
PooledConnection:oracle.jdbc.datasource.OracleConnectionPoolDataSource ocpds = new oracle.jdbc.datasource.impl.OracleConnectionPoolDataSource(); ocpds.setURL("jdbc:oracle:thin:@//dbhost:dbport/dbservice"); ocpds.setUser("User"); ocpds.setPassword("Passwd"); ocpds.setConnectionProperty("connProp1", "value1"); ocpds.setConnectionProperty("connProp2", "value2"); javax.sql.PooledConnection pc = ocpds.getPooledConnection();The following example illustrates the use of a connection obtained from this data source for Application Continuity protection:
PooledConnection pc = rcpds.getPooledConnection(); Connection conn = pc.getConnection(); // Implicit request begin ...... // JDBC calls protected by Application Continuity conn.close(); // Implicit request end- Since:
- 20c
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class oracle.jdbc.datasource.impl.OracleDataSource
CHECKSUM_PROPERTY, clientChecksum11203x, clientChecksum12x, connectionProperties, databaseName, dataSourceName, DEFAULT_SERVICE_NAME, description, doneDumpOnMemoryPressure, driver, driverType, ENABLE_AC_SUPPORT_PROPERTY, explicitCachingEnabled, explicitCachingEnabledSet, FAILOVER_RESTORE_AUTO, FAILOVER_RESTORE_LEVEL1, FAILOVER_RESTORE_LEVEL2, FAILOVER_RESTORE_NONE, FAILOVER_RESTORE_PROPERTY, FAILOVER_TYPE_AUTO, FAILOVER_TYPE_PROPERTY, FAILOVER_TYPE_TRANSACTION, IGNORE_AC_CONTEXT_PROPERTY, implicitCachingEnabled, implicitCachingEnabledSet, INITIATION_TIMEOUT_PROPERTY, isAutoACEnabled, isFirstConnection, isOracleDataSource, isReplayInDynamicMode, isStateRestorationAuto, isTransactionReplayEnabled, loginTimeout, logWriter, maxStatements, maxStatementsSet, networkProtocol, password, portNumber, RECONNECT_DELAY_PROPERTY, RECONNECT_RETRIES_PROPERTY, reconnectDelay, reconnectRetries, replayInitiationTimeout, REQUEST_SIZE_LIMIT_PROPERTY, serverName, serviceName, SESSION_STATE_CONSISTENCY_STATIC, SESSION_STATE_PROPERTY, stateRestorationType, tnsEntry, TRACE, url, user
-
Fields inherited from interface oracle.jdbc.replay.OracleDataSource
CONNECTION_PROPERTIES, DATA_SOURCE_NAME, DATABASE_NAME, DESCRIPTION, EXPLICIT_CACHING_ENABLED, IMPLICIT_CACHING_ENABLED, MAX_STATEMENTS, NETWORK_PROTOCOL, PASSWORD, PORT_NUMBER, ROLE_NAME, SERVER_NAME, URL, USER
-
-
Constructor Summary
Constructors Constructor Description OracleConnectionPoolDataSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OraclePooledConnectionBuildercreatePooledConnectionBuilder()Creates a newOraclePooledConnectionBuilderinstanceConnectiongetConnection()Attempt to establish a database connection.ConnectiongetConnection(String usr, String pwd)Attempt to establish a database connection.ConnectiongetConnection(Properties props)protected ConnectiongetPhysicalConnection()Get a Physical Connection with default url, user name, and passwordprotected ConnectiongetPhysicalConnection(String _user, String _passwd)Get a Physical Connection with the user name and password & default URLprotected ConnectiongetPhysicalConnection(String _url, String _user, String _passwd)Get a Physical Connection with the given url, user name, and passwordprotected ConnectiongetPhysicalConnection(String _url, String _user, oracle.jdbc.internal.OpaqueString _passwd)Get a Physical Connection with the given url, user name, and passwordprotected ConnectiongetPhysicalConnection(String _user, oracle.jdbc.internal.OpaqueString _passwd)Get a Physical Connection with the user name and password & default URLPooledConnectiongetPooledConnection()Attempt to establish a database connection.PooledConnectiongetPooledConnection(String _user, String _password)Attempt to establish a database connection.protected OraclePooledConnectiongetPooledConnection(OracleConnectionBuilderImpl connBuilder)-
Methods inherited from class oracle.jdbc.datasource.impl.OracleDataSource
addRefProperties, cleanup, clearDoneDumpOnMemoryPressure, clearReplayStatistics, createConnectionBuilder, debug, enableACAndProxifyIfNecessary, getConnection, getConnection, getConnectionDuringExceptionHandling, getConnectionInitializationCallback, getConnectionNoProxy, getConnectionProperties, getConnectionProperty, getDatabaseName, getDataSourceName, getDescription, getDriverType, getExplicitCachingEnabled, getImplicitCachingEnabled, getLoginTimeout, getLogWriter, getMaxStatements, getMonitorLock, getNetworkProtocol, getParentLogger, getPassword, getPhysicalConnection, getPortNumber, getProxyFactory, getReference, getReplayStatistics, getReplayStatisticsString, getRequestSizeLimit, getRoleName, getServerName, getServiceName, getSystemProperty, getTNSEntryName, getURL, getUser, isWrapperFor, makeURL, registerConnectionInitializationCallback, registerMBean, setConnectionProperties, setConnectionProperty, setDatabaseName, setDataSourceName, setDescription, setDriverType, setExplicitCachingEnabled, setHostnameResolver, setImplicitCachingEnabled, setLoginTimeout, setLogWriter, setMaxStatements, setNetworkProtocol, setPassword, setPortNumber, setRoleName, setServerName, setServiceName, setSingleShardTransactionSupport, setSSLContext, setTNSEntryName, setTokenSupplier, setupACSpecificProperties, setURL, setUser, trace, unregisterConnectionInitializationCallback, unregisterMBean, unwrap, updateReplayStatistics
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.sql.CommonDataSource
getParentLogger
-
Methods inherited from interface javax.sql.ConnectionPoolDataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
-
Methods inherited from interface javax.sql.DataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
-
Methods inherited from interface oracle.jdbc.internal.Monitor
acquireCloseableLock, acquireLock, newDefaultLock, releaseLock
-
Methods inherited from interface oracle.jdbc.datasource.OracleCommonDataSource
createShardingKeyBuilder, getConnectionProperties, getConnectionProperty, getDatabaseName, getDataSourceName, getDescription, getNetworkProtocol, getPortNumber, getServerName, getURL, getUser, setConnectionProperties, setConnectionProperty, setDatabaseName, setDataSourceName, setDescription, setHostnameResolver, setNetworkProtocol, setPassword, setPortNumber, setServerName, setSingleShardTransactionSupport, setSSLContext, setTokenSupplier, setURL, setUser
-
Methods inherited from interface oracle.jdbc.datasource.OracleDataSource
createConnectionBuilder
-
Methods inherited from interface oracle.jdbc.replay.internal.OracleDataSource
clearDoneDumpOnMemoryPressure, getConnectionNoProxy, getProxyFactory, getReplayStatisticsString, getRequestSizeLimit, updateReplayStatistics
-
Methods inherited from interface oracle.jdbc.replay.OracleDataSource
clearReplayStatistics, getConnectionInitializationCallback, getExplicitCachingEnabled, getImplicitCachingEnabled, getMaxStatements, getReplayStatistics, getRoleName, registerConnectionInitializationCallback, setExplicitCachingEnabled, setImplicitCachingEnabled, setMaxStatements, setRoleName, unregisterConnectionInitializationCallback
-
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
-
-
-
Constructor Detail
-
OracleConnectionPoolDataSource
public OracleConnectionPoolDataSource() throws SQLException- Throws:
SQLException
-
-
Method Detail
-
getPooledConnection
public PooledConnection getPooledConnection() throws SQLException
Attempt to establish a database connection.
- Specified by:
getPooledConnectionin interfaceConnectionPoolDataSource- Specified by:
getPooledConnectionin interfaceOracleConnectionPoolDataSource- Returns:
- a PooledConnection to the database
- Throws:
SQLException- if a database-access error occurs.
-
getPooledConnection
public PooledConnection getPooledConnection(String _user, String _password) throws SQLException
Attempt to establish a database connection.
- Specified by:
getPooledConnectionin interfaceConnectionPoolDataSource- Specified by:
getPooledConnectionin interfaceOracleConnectionPoolDataSource- Parameters:
user- the database user on whose behalf the Connection is being madepassword- the user's password- Returns:
- a PooledConnection to the database
- Throws:
SQLException- if a database-access error occurs.
-
getPhysicalConnection
protected Connection getPhysicalConnection() throws SQLException
Get a Physical Connection with default url, user name, and password- Throws:
SQLException
-
getPhysicalConnection
protected Connection getPhysicalConnection(String _url, String _user, String _passwd) throws SQLException
Get a Physical Connection with the given url, user name, and password- Throws:
SQLException
-
getPhysicalConnection
protected Connection getPhysicalConnection(String _user, String _passwd) throws SQLException
Get a Physical Connection with the user name and password & default URL- Throws:
SQLException
-
getPhysicalConnection
protected Connection getPhysicalConnection(String _url, String _user, oracle.jdbc.internal.OpaqueString _passwd) throws SQLException
Get a Physical Connection with the given url, user name, and password- Throws:
SQLException
-
getPhysicalConnection
protected Connection getPhysicalConnection(String _user, oracle.jdbc.internal.OpaqueString _passwd) throws SQLException
Get a Physical Connection with the user name and password & default URL- Throws:
SQLException
-
getPooledConnection
protected OraclePooledConnection getPooledConnection(OracleConnectionBuilderImpl connBuilder) throws SQLException
- Throws:
SQLException
-
createPooledConnectionBuilder
public OraclePooledConnectionBuilder createPooledConnectionBuilder() throws SQLException
Description copied from interface:OracleConnectionPoolDataSourceCreates a newOraclePooledConnectionBuilderinstance- Specified by:
createPooledConnectionBuilderin interfaceConnectionPoolDataSource- Specified by:
createPooledConnectionBuilderin interfaceOracleConnectionPoolDataSource- Returns:
- The
OraclePooledConnectionBuilderinstance that was created - Throws:
SQLException- if an error occurs while creating the builder
-
getConnection
public Connection getConnection() throws SQLException
Description copied from class:OracleDataSourceAttempt to establish a database connection.
- Specified by:
getConnectionin interfaceDataSource- Overrides:
getConnectionin classOracleDataSource- Returns:
- a Connection to the database
- Throws:
SQLException- if a database-access error occurs.
-
getConnection
public Connection getConnection(String usr, String pwd) throws SQLException
Description copied from class:OracleDataSourceAttempt to establish a database connection.
- Specified by:
getConnectionin interfaceDataSource- Overrides:
getConnectionin classOracleDataSource- Parameters:
usr- the database user on whose behalf the Connection is being madepwd- the user's password- Returns:
- a Connection to the database
- Throws:
SQLException- if a database-access error occurs.
-
getConnection
public Connection getConnection(Properties props) throws SQLException
- Throws:
SQLException
-
-