public class OracleOCIConnectionPool extends OracleDataSource
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONNECTION_ID |
static java.lang.String |
CONNECTION_POOL |
static java.lang.String |
CONNPOOL_ACTIVE_SIZE |
static java.lang.String |
CONNPOOL_ALIASED_CONNECTION |
static java.lang.String |
CONNPOOL_CONNECTION |
static java.lang.String |
CONNPOOL_INCREMENT |
static java.lang.String |
CONNPOOL_IS_POOLCREATED |
static java.lang.String |
CONNPOOL_LOGON_MODE |
static java.lang.String |
CONNPOOL_MAX_LIMIT |
static java.lang.String |
CONNPOOL_MIN_LIMIT |
static java.lang.String |
CONNPOOL_NOWAIT |
static java.lang.String |
CONNPOOL_OBJECT |
static java.lang.String |
CONNPOOL_POOL_SIZE |
static java.lang.String |
CONNPOOL_PROXY_CONNECTION |
static java.lang.String |
CONNPOOL_TIMEOUT |
static java.lang.String |
IS_CONNECTION_POOLING |
oracle.jdbc.oci.OracleOCIConnection |
m_connection_pool |
protected int |
m_stmtCacheSize |
protected boolean |
m_stmtClearMetaData |
static java.lang.String |
PROXY_CERTIFICATE |
static java.lang.String |
PROXY_DISTINGUISHED_NAME |
static java.lang.String |
PROXY_NUM_ROLES |
static java.lang.String |
PROXY_PASSWORD |
static java.lang.String |
PROXY_ROLES |
static java.lang.String |
PROXY_USER_NAME |
static java.lang.String |
PROXYTYPE |
static java.lang.String |
PROXYTYPE_CERTIFICATE |
static java.lang.String |
PROXYTYPE_DISTINGUISHED_NAME |
static java.lang.String |
PROXYTYPE_USER_NAME |
static java.lang.String |
TRANSACTIONS_DISTRIBUTED |
CHECKSUM_PROPERTY, clientChecksum11203x, clientChecksum12x, connectionProperties, databaseName, dataSourceName, DEFAULT_SERVICE_NAME, description, DMS_DEFAULT_DATASOURCE_NAME, DMS_ROOT_NAME, doneDumpOnMemoryPressure, driver, driverType, ENABLE_AC_SUPPORT_PROPERTY, ENABLE_SSS_CURSOR_SUPPORT_PROPERTY, explicitCachingEnabled, explicitCachingEnabledSet, FAILOVER_RESTORE_AUTO, FAILOVER_RESTORE_LEVEL1, FAILOVER_RESTORE_LEVEL2, FAILOVER_RESTORE_NONE, FAILOVER_RESTORE_PROPERTY, FAILOVER_TYPE_AUTO, FAILOVER_TYPE_ON_REMOTE, FAILOVER_TYPE_PROPERTY, FAILOVER_TYPE_TRANSACTION, IGNORE_AC_CONTEXT_PROPERTY, implicitCachingEnabled, implicitCachingEnabledSet, INITIATION_TIMEOUT_PROPERTY, isAutoACEnabled, isFirstConnection, isHybrid, isOracleDataSource, isReplayInDynamicMode, isSSSCursorEnabled, 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_HYBRID, SESSION_STATE_CONSISTENCY_STATIC, SESSION_STATE_PROPERTY, stateRestorationType, tnsEntry, TRACE, trackerInitialized, unnamedInstanceCount, url, userCONNECTION_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 and Description |
|---|
OracleOCIConnectionPool()
This will use the user-id, password and connection pool name values
set using the methods setUser, setPassword, setConnectionPoolName.
|
OracleOCIConnectionPool(java.lang.String us,
java.lang.String p,
java.lang.String url)
Deprecated.
|
OracleOCIConnectionPool(java.lang.String us,
java.lang.String p,
java.lang.String url,
java.util.Properties info)
Notes: Choose an userid and password that can act as proxy for the users
in the getProxyConnection() method.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
This will destroy the connection pool, and close all the connections
opened from this data source.
|
void |
connectionClosed(oracle.jdbc.oci.OracleOCIConnection conn) |
int |
getActiveSize()
Return the number of active or busy connections in the connection pool
Note that the count cannot be guaranteed on any invoking subsequent
OracleOCIConnectionCacheImpl method.
|
oracle.jdbc.internal.OracleConnection |
getAliasedConnection(byte[] conId)
For creating aliased sessions.
|
java.sql.Connection |
getConnection()
Attempt to establish a database connection.
|
java.sql.Connection |
getConnection(java.lang.String us,
java.lang.String p)
For getting a connection to the database.
|
protected oracle.jdbc.internal.OracleConnection |
getConnectionDuringExceptionHandling() |
int |
getConnectionIncrement()
Return the Increment for increasing the connections for the Cache.
|
int |
getMaxLimit()
Return the Max limit on Connections.
|
int |
getMinLimit()
Note: There are no individual setMin, setMax and setIncrement since
that needs to be done in one call to setPoolConfig
Return the minimum limit on the no of Connections.
|
java.lang.String |
getNoWait()
Return the connection No-wait parameter
This attribute determines if retrial for a connection has to be done
when all connections in the pool are found to be busy and the number
of connections already reached max.
|
java.util.Properties |
getPoolConfig() |
int |
getPoolSize()
Return the number of physical connections in the connection pool
Note that the count cannot be guaranteed on any invoking subsequent
OracleOCIConnectionCacheImpl method.
|
oracle.jdbc.internal.OracleConnection |
getProxyConnection(java.lang.String proxytype,
java.util.Properties prop)
For creating a proxy connection.
|
javax.naming.Reference |
getReference()
Inherited from referencable
|
int |
getStmtCacheSize()
Return the size of Statement Cache.
|
int |
getTimeout()
Return the timeout
The connections idle for more than this time (seconds) are
terminated periodically, to maintain optimum number of open
connections.This attribute can be set dynamically.
|
boolean |
isDistributedTransEnabled() |
boolean |
isPoolCreated()
check if the pool has been created.
|
boolean |
isStmtCacheEnabled()
Check whether Statement
Caching is enabled for this pool or Not.
|
static void |
readPoolConfig(int minLimit,
int maxLimit,
int increment,
int timeout,
boolean nowait,
boolean transactionsDistributed,
int[] p)
read the properties into an integer array
|
static void |
readPoolConfig(java.util.Properties info,
int[] p) |
void |
setPoolConfig(java.util.Properties prop)
(Re-)Set the pool configuration for the Cache.
|
void |
setStmtCacheSize(int size)
Set the statement cache size.
|
void |
setStmtCacheSize(int size,
boolean clearMetaData)
Set the statement cache size.
|
addRefProperties, cleanup, clearDoneDumpOnMemoryPressure, clearReplayStatistics, createConnectionBuilder, dms_data_source_type, enableACAndProxifyIfNecessary, finalize, getConnection, getConnection, getConnectionInitializationCallback, getConnectionNoProxy, getConnectionProperties, getConnectionProperty, getDatabaseName, getDataSourceName, getDescription, getDiagnosable, getDriverType, getExplicitCachingEnabled, getImplicitCachingEnabled, getLoginTimeout, getLogWriter, getMaxStatements, getMonitorLock, getNetworkProtocol, getParentLogger, getPassword, getPhysicalConnection, getPortNumber, getProxyFactory, getReplayStatistics, getReplayStatisticsString, getRequestSizeLimit, getRoleName, getServerName, getServiceName, getSSSCursorProperty, getSystemProperty, getTNSEntryName, getURL, getUser, isWrapperFor, makeURL, registerConnectionInitializationCallback, registerMBean, removeReplayStatistics, 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, unregisterConnectionInitializationCallback, unregisterMBean, unwrap, updateReplayStatisticsclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbegin, beginCurrentSql, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debugp, end, endCurrentSql, format, isDebugEnabled, isDiagnoseFirstFailureEnabled, isLoggable, isSensitiveEnabled, onClose, propertyChange, resumeLogging, secure, suspendLogging, trace, tracepsetExecutorServicecreateShardingKeyBuilderpublic oracle.jdbc.oci.OracleOCIConnection m_connection_pool
public static final java.lang.String IS_CONNECTION_POOLING
public static final java.lang.String CONNPOOL_OBJECT
public static final java.lang.String CONNPOOL_LOGON_MODE
public static final java.lang.String CONNECTION_POOL
public static final java.lang.String CONNPOOL_CONNECTION
public static final java.lang.String CONNPOOL_PROXY_CONNECTION
public static final java.lang.String CONNPOOL_ALIASED_CONNECTION
public static final java.lang.String PROXY_USER_NAME
public static final java.lang.String PROXY_DISTINGUISHED_NAME
public static final java.lang.String PROXY_CERTIFICATE
public static final java.lang.String PROXY_ROLES
public static final java.lang.String PROXY_NUM_ROLES
public static final java.lang.String PROXY_PASSWORD
public static final java.lang.String PROXYTYPE
public static final java.lang.String PROXYTYPE_USER_NAME
public static final java.lang.String PROXYTYPE_DISTINGUISHED_NAME
public static final java.lang.String PROXYTYPE_CERTIFICATE
public static final java.lang.String CONNECTION_ID
public static final java.lang.String CONNPOOL_MIN_LIMIT
public static final java.lang.String CONNPOOL_MAX_LIMIT
public static final java.lang.String CONNPOOL_INCREMENT
public static final java.lang.String CONNPOOL_ACTIVE_SIZE
public static final java.lang.String CONNPOOL_POOL_SIZE
public static final java.lang.String CONNPOOL_TIMEOUT
public static final java.lang.String CONNPOOL_NOWAIT
public static final java.lang.String CONNPOOL_IS_POOLCREATED
public static final java.lang.String TRANSACTIONS_DISTRIBUTED
protected int m_stmtCacheSize
protected boolean m_stmtClearMetaData
public OracleOCIConnectionPool(java.lang.String us,
java.lang.String p,
java.lang.String url,
java.util.Properties info)
throws java.sql.SQLException
us - ConnectionPool user-id.p - ConnectionPool passwordurl - This would be the full url including the database name.
The database name would be the logical name of the pool.info - Set of properties (optional) for specifying the pool
configuration.java.sql.SQLExceptionpublic OracleOCIConnectionPool(java.lang.String us,
java.lang.String p,
java.lang.String url)
throws java.sql.SQLException
java.sql.SQLExceptionpublic OracleOCIConnectionPool()
throws java.sql.SQLException
Notes: No useful operations (like getConnection) can be performed on this class unless the methods setUser, setPassword, setConnectionPoolName are invoked. Choose an userid and password that can act as proxy for the users in the getProxyConnection() method.
java.sql.SQLExceptionpublic java.sql.Connection getConnection()
throws java.sql.SQLException
OracleDataSourceAttempt to establish a database connection.
getConnection in interface javax.sql.DataSourcegetConnection in class OracleDataSourcejava.sql.SQLException - if a database-access error occurs.public java.sql.Connection getConnection(java.lang.String us,
java.lang.String p)
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcegetConnection in class OracleDataSourceus - Connection user-idp - Connection passwordjava.sql.SQLException - if a database-access error occurs.public javax.naming.Reference getReference()
throws javax.naming.NamingException
getReference in interface javax.naming.ReferenceablegetReference in class OracleDataSourcejavax.naming.NamingExceptionpublic oracle.jdbc.internal.OracleConnection getProxyConnection(java.lang.String proxytype,
java.util.Properties prop)
throws java.sql.SQLException
Notes: The user and password used to create OracleOCIConnectionPool() must be allowed to act as proxy for user 'us'.
proxytype - Can be one of following types
OracleOCIConnectionPool.PROXYCONNECTION_USER_NAME
- This will be the normal mode of specifying the username
in proxyUser
OracleOCIConnectionPool.PROXYCONNECTION_DISTINGUISHED_NAME
- This will specify the distinguished name of the user in
proxyUser
OracleOCIConnectionPool.PROXYCONNECTION_CERTIFICATE
- This will specify the proxy certificate in proxyUserproxyUser - The user, or certificate, to be proxied against.roles - Set of roles which this proxy connection can usejava.sql.SQLExceptionpublic oracle.jdbc.internal.OracleConnection getAliasedConnection(byte[] conId)
throws java.sql.SQLException
Notes: Once this call is issued, this connection object can't be used for any operation, as the intent for connection cloning is failover.
conId - - byte[] of the connection idjava.sql.SQLExceptionpublic void close()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void setPoolConfig(java.util.Properties prop)
throws java.sql.SQLException
prop - java.sql.SQLExceptionpublic static void readPoolConfig(int minLimit,
int maxLimit,
int increment,
int timeout,
boolean nowait,
boolean transactionsDistributed,
int[] p)
public static void readPoolConfig(java.util.Properties info,
int[] p)
public java.util.Properties getPoolConfig()
throws java.sql.SQLException
java.sql.SQLExceptionpublic int getActiveSize()
throws java.sql.SQLException
java.sql.SQLExceptionpublic int getPoolSize()
throws java.sql.SQLException
java.sql.SQLExceptionpublic int getTimeout()
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.lang.String getNoWait()
throws java.sql.SQLException
java.sql.SQLExceptionpublic int getMinLimit()
throws java.sql.SQLException
java.sql.SQLExceptionpublic int getMaxLimit()
throws java.sql.SQLException
java.sql.SQLExceptionpublic int getConnectionIncrement()
throws java.sql.SQLException
java.sql.SQLExceptionpublic boolean isDistributedTransEnabled()
public boolean isPoolCreated()
public void connectionClosed(oracle.jdbc.oci.OracleOCIConnection conn)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void setStmtCacheSize(int size)
throws java.sql.SQLException
size - Size of the Cachejava.sql.SQLExceptionpublic void setStmtCacheSize(int size,
boolean clearMetaData)
throws java.sql.SQLException
size - Size of the CacheclearMetaData - Whether the state has to be cleared or notjava.sql.SQLExceptionpublic int getStmtCacheSize()
public boolean isStmtCacheEnabled()
protected oracle.jdbc.internal.OracleConnection getConnectionDuringExceptionHandling()
getConnectionDuringExceptionHandling in class OracleDataSource