public class PoolDataSourceImpl extends java.lang.Object implements PoolDataSource, java.io.Serializable, javax.naming.Referenceable, javax.naming.spi.ObjectFactory, UniversalConnectionPoolAdapter
Besides other data source properties, applications must set the connection factory class name. The connection factory class is a class that implements javax.sql.DataSource and does not implement its own connection pooling. The connection factory's getConnection(...) methods should return a physical JDBC connection to the database. For example, "oracle.jdbc.pool.OracleDataSource" is a valid connection factory class name.
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Object |
m_connectionFactory |
protected java.lang.String |
m_connectionFactoryClassName |
protected oracle.ucp.jdbc.JDBCConnectionPool |
m_cp |
static java.lang.String |
SECRET_STORE_CONNECT |
static java.lang.String |
SECRET_STORE_DEFAULT_PASSWORD |
static java.lang.String |
SECRET_STORE_DEFAULT_USERNAME |
static java.lang.String |
SECRET_STORE_PASSWORD |
static java.lang.String |
SECRET_STORE_USERNAME |
UCP_ABANDONED_CONNECTION_TIMEOUT, UCP_CONNECTION_AFFINITY_CALLBACK, UCP_CONNECTION_FACTORY_CLASS_NAME, UCP_CONNECTION_FACTORY_PROPERTIES, UCP_CONNECTION_HARVEST_MAX_COUNT, UCP_CONNECTION_HARVEST_TRIGGER_COUNT, UCP_CONNECTION_INITIALIZATION_CALLBACK, UCP_CONNECTION_LABELING_CALLBACK, UCP_CONNECTION_LABELING_HIGH_COST, UCP_CONNECTION_POOL_NAME, UCP_CONNECTION_PROPERTIES, UCP_CONNECTION_REPURPOSE_THRESHOLD, UCP_CONNECTION_WAIT_TIMEOUT, UCP_DATA_SOURCE_FROM_CONFIGURATION, UCP_DATA_SOURCE_NAME, UCP_DATABASE_NAME, UCP_DESCRIPTION, UCP_FAST_CONNECTION_FAILOVER_ENABLED, UCP_HIGH_COST_CONNECTION_REUSE_THRESHOLD, UCP_INACTIVE_CONNECTION_TIMEOUT, UCP_INITIAL_POOL_SIZE, UCP_LOGIN_TIMEOUT, UCP_MAX_CONNECTION_REUSE_COUNT, UCP_MAX_CONNECTION_REUSE_TIME, UCP_MAX_CONNECTIONS_PER_SERVICE, UCP_MAX_CONNECTIONS_PER_SHARD, UCP_MAX_IDLE_TIME, UCP_MAX_POOL_SIZE, UCP_MAX_STATEMENTS, UCP_MIN_POOL_SIZE, UCP_NETWORK_PROTOCOL, UCP_NTH_RETURNED_CONNECTION_TO_VALIDATE, UCP_ONS_CONFIGURATION, UCP_PASSWORD, UCP_PDB_ROLES, UCP_PORT_NUMBER, UCP_PROPERTY_CYCLE, UCP_ROLE_NAME, UCP_SECONDS_TO_TRUST_IDLE_CONNECTION, UCP_SERVER_NAME, UCP_SERVICE_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 and Description |
|---|
PoolDataSourceImpl() |
| Modifier and Type | Method and Description |
|---|---|
UCPConnectionBuilder |
createConnectionBuilder()
Creates a new UCPConnectionBuilder instance.
|
protected void |
createPoolWithDefaultProperties() |
UniversalConnectionPool |
createUniversalConnectionPool()
Creates a Universal Connection Pool instance using this adapter.
|
UniversalConnectionPoolMBean |
createUniversalConnectionPoolMBean()
Creates a Universal Connection Pool MBean using this adapter.
|
int |
getAbandonedConnectionTimeout()
Gets the abandoned connection timeout value.
|
int |
getAvailableConnectionsCount()
Gets the number of available connections in the pool.
|
int |
getBorrowedConnectionsCount()
Gets the number of borrowed connections from the pool.
|
java.sql.Connection |
getConnection()
Attempts to obtain a database connection.
|
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)
Attempts to obtain a database connection.
|
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.
|
java.lang.String |
getConnectionFactoryClassName()
Gets the Connection Factory class name.
|
java.util.Properties |
getConnectionFactoryProperties()
Gets the connection factory properties that are set on this
data source.
|
java.lang.String |
getConnectionFactoryProperty(java.lang.String propertyName)
Gets the specified connection factory property that are set on
this data source.
|
int |
getConnectionHarvestMaxCount()
Gets the maximum number of connections that may be harvested when the
connection harvesting occurs.
|
int |
getConnectionHarvestTriggerCount()
Gets the number of available connections at which the connection pool's
connection harvesting will occur.
|
ConnectionInitializationCallback |
getConnectionInitializationCallback()
Obtains the registered connection initialization callback, if any.
|
int |
getConnectionLabelingHighCost()
Obtains the cost value which identifies a connection as "high-cost"
for connection labeling.
|
java.lang.String |
getConnectionPoolName()
Gets the connection pool name.
|
java.util.Properties |
getConnectionProperties()
Gets the connection properties that are set on this data source.
|
java.lang.String |
getConnectionProperty(java.lang.String propertyName)
Gets the specified connection property that are set on
this data source.
|
int |
getConnectionRepurposeThreshold()
Gets the connection repurpose threshold for the pool.
|
int |
getConnectionWaitTimeout()
Gets the amount of time to wait (in seconds) for a used connection to
be released by a client.
|
java.lang.String |
getDatabaseName()
Gets the database name.
|
java.lang.String |
getDataSourceName()
Gets the data source name.
|
java.lang.String |
getDescription()
Gets the data source description.
|
boolean |
getFastConnectionFailoverEnabled()
Checks if Fast Connection Failover is enabled.
|
int |
getHighCostConnectionReuseThreshold()
Obtains the high-cost connection reuse threshold property
value for connection labeling.
|
int |
getInactiveConnectionTimeout()
Gets the inactive connection timeout.
|
int |
getInitialPoolSize()
Gets the initial pool size.
|
int |
getLoginTimeout()
Gets the default maximum time in seconds that a driver will wait while attempting
to connect to a database once the driver has been identified.
|
java.io.PrintWriter |
getLogWriter() |
int |
getMaxConnectionReuseCount()
Gets the connection reuse count property.
|
long |
getMaxConnectionReuseTime()
Gets the connection reuse time property.
|
int |
getMaxConnectionsPerService()
Gets the maximum number of connections that can be obtained to a particular
service, in a shared pool.
|
int |
getMaxConnectionsPerShard()
Gets the currently configured max connections that can be created per shard
in a sharded database configuration.
|
int |
getMaxIdleTime()
Gets Idle timeout value.
|
int |
getMaxPoolSize()
Gets the maximum number of connections that the connection pool will
maintain.
|
int |
getMaxStatements()
Gets the maximum number of statements that may be pooled or cached on a
Connection.
|
int |
getMinPoolSize()
Gets the minimum number of connections that the connection pool will
maintain.
|
java.lang.String |
getNetworkProtocol()
Gets the datasource networkProtocol.
|
java.lang.Object |
getObjectInstance(java.lang.Object refObj,
javax.naming.Name name,
javax.naming.Context nameCtx,
java.util.Hashtable env) |
java.lang.String |
getONSConfiguration()
Returns the ONS configuration string that is used for remote ONS
subscription, in the form specified in setONSConfiguration(String).
|
java.util.logging.Logger |
getParentLogger() |
java.lang.String |
getPassword()
Gets the Password for this data source.
|
java.util.Properties |
getPdbRoles()
Gets the PDB roles specified for this datasource
|
int |
getPortNumber()
Gets the database port number.
|
int |
getPropertyCycle()
Gets Property cycle in seconds.
|
int |
getQueryTimeout()
Gets the number of seconds the driver will wait for a Statement object to execute to the given number of seconds.
|
javax.naming.Reference |
getReference() |
java.lang.String |
getRoleName()
Gets the datasource role name.
|
int |
getSecondsToTrustIdleConnection()
Gets the seconds To Trust Idle Connection value.
|
java.lang.String |
getServerName()
Gets the database server name.
|
java.lang.String |
getServiceName()
Gets the service name set on this data source
|
java.lang.String |
getSQLForValidateConnection()
Gets the Value for SQLForValidateConnection property.
|
JDBCConnectionPoolStatistics |
getStatistics()
Gets the statistics of the connection pool.
|
int |
getTimeoutCheckInterval()
Gets the timeout check interval (in seconds).
|
int |
getTimeToLiveConnectionTimeout()
Gets the maximum time (in seconds) a connection may remain in-use.
|
java.lang.String |
getURL()
Gets the URL for this data source.
|
java.lang.String |
getUser()
Gets the user name for this data source.
|
boolean |
getValidateConnectionOnBorrow()
Returns whether or not a connection being borrowed should first be
validated.
|
protected void |
ilogFine(java.util.logging.Logger logger,
java.lang.Class cls,
java.lang.reflect.Executable method,
java.lang.Object receiver,
java.lang.String message) |
protected void |
ilogFinest(java.util.logging.Logger logger,
java.lang.Class cls,
java.lang.reflect.Executable method,
java.lang.Object receiver,
java.lang.String message)
Helpers for writing into log and logWriter
|
protected void |
ilogSevere(java.util.logging.Logger logger,
java.lang.Class cls,
java.lang.reflect.Executable method,
java.lang.Object receiver,
java.lang.String message) |
protected void |
ilogThrowing(java.util.logging.Logger logger,
java.lang.Class cls,
java.lang.reflect.Executable method,
java.lang.Object receiver,
java.lang.Throwable throwable) |
protected void |
ilogWarning(java.util.logging.Logger logger,
java.lang.Class cls,
java.lang.reflect.Executable method,
java.lang.Object receiver,
java.lang.String message) |
boolean |
isWrapperFor(java.lang.Class<?> iface)
Since this class is not a wrapper, just check to see if this implements the
requested interface.
|
void |
reconfigureDataSource(java.util.Properties configuration)
Reconfigures the data source.
|
void |
registerConnectionAffinityCallback(ConnectionAffinityCallback cbk)
Registers a ConnectionAffinityCallback on the connection pool.
|
void |
registerConnectionInitializationCallback(ConnectionInitializationCallback cbk)
Registers a connection initialization callback.
|
void |
registerConnectionLabelingCallback(ConnectionLabelingCallback cbk)
Registers a ConnectionLabelingCallback with the underlying connection
pool.
|
void |
removeConnectionAffinityCallback()
Removes the ConnectionAffinityCallback registered on the connection pool.
|
void |
removeConnectionLabelingCallback()
Removes the ConnectionLabelingCallback object registered with the
underlying connection pool, if any.
|
void |
setAbandonedConnectionTimeout(int abandonedConnectionTimeout)
Sets the abandoned connection timeout.
|
void |
setConnectionFactoryClassName(java.lang.String factoryClassName)
Sets the Connection Factory class name.
|
void |
setConnectionFactoryProperties(java.util.Properties factoryProperties)
Sets the connection factory properties on the connection factory.
|
void |
setConnectionFactoryProperty(java.lang.String name,
java.lang.String value)
Sets a connection factory property on the connection factory.
|
void |
setConnectionHarvestMaxCount(int connectionHarvestMaxCount)
Sets the maximum number of connections that may be harvested when the
connection harvesting occurs.
|
void |
setConnectionHarvestTriggerCount(int connectionHarvestTriggerCount)
Sets the number of available connections at which the connection pool's
connection harvesting will occur.
|
void |
setConnectionLabelingHighCost(int highCost)
Sets the cost value which identifies a connection as "high-cost"
for connection labeling.
|
void |
setConnectionPoolName(java.lang.String connectionPoolName)
Sets the connection pool name.
|
void |
setConnectionProperties(java.util.Properties connectionProperties)
Sets the connection properties on the connection factory.
|
void |
setConnectionProperty(java.lang.String name,
java.lang.String value)
Sets a connection property on the connection factory.
|
void |
setConnectionRepurposeThreshold(int threshold)
Sets the connection repurpose threshold for the pool.
|
void |
setConnectionWaitTimeout(int waitTimeout)
Sets the amount of time to wait (in seconds) for a used connection to
be released by a client.
|
void |
setDatabaseName(java.lang.String databaseName)
Sets the database name.
|
void |
setDataSourceName(java.lang.String dataSourceName)
Sets the data source name.
|
void |
setDescription(java.lang.String description)
Sets the data source description.
|
void |
setFastConnectionFailoverEnabled(boolean failoverEnabled)
Enables Fast Connection Failover (FCF) for the connection pool accessed
using this pool-enabled data source.
|
void |
setHighCostConnectionReuseThreshold(int threshold)
Sets the high-cost connection reuse threshold for connection labeling.
|
void |
setInactiveConnectionTimeout(int inactivityTimeout)
Sets the inactive connection timeout.
|
void |
setInitialPoolSize(int initialPoolSize)
Sets the initial pool size.
|
void |
setLoginTimeout(int seconds)
Sets the default maximum time in seconds that a driver will wait while attempting
to connect to a database once the driver has been identified.
|
void |
setLogWriter(java.io.PrintWriter logWriter) |
void |
setMaxConnectionReuseCount(int maxConnectionReuseCount)
Gets the connection reuse count property.
|
void |
setMaxConnectionReuseTime(long maxConnectionReuseTime)
Gets the connection reuse time property.
|
void |
setMaxConnectionsPerShard(int maxConnectionsPerShard)
Sets the max number of connections that can be created per shard in a
sharded database configuration.
|
void |
setMaxIdleTime(int idleTime)
Sets Idle timeout for available connections in the pool.
|
void |
setMaxPoolSize(int maxPoolSize)
Sets the maximum number of connections.
|
void |
setMaxStatements(int maxStatements)
Sets the maximum number of statements that may be pooled or cached on
a connection.
|
void |
setMinPoolSize(int minPoolSize)
Sets the minimum number of connections.
|
void |
setNetworkProtocol(java.lang.String networkProtocol)
Sets the datasource networkProtocol.
|
void |
setONSConfiguration(java.lang.String onsConfigStr)
Sets the configuration string used for remote ONS subscription.
|
void |
setPassword(java.lang.String password)
Sets the password with which connections have to be obtained.
|
void |
setPortNumber(int portNumber)
Sets the database port number.
|
void |
setPropertyCycle(int propertyCycle)
Sets Property cycle in seconds.
|
void |
setQueryTimeout(int queryTimeout)
Sets the number of seconds the driver will wait for a Statement object to execute to the given number of seconds.
|
void |
setRoleName(java.lang.String roleName)
Sets the datasource role name.
|
void |
setSecondsToTrustIdleConnection(int secondsToTrustIdleConnection)
Sets the time in seconds to trust an idle connection to skip a validation
test.
|
void |
setServerName(java.lang.String serverName)
Sets the database server name.
|
void |
setSQLForValidateConnection(java.lang.String SQLString)
Sets the value(SQL) for SQLForValidateConnection property.
|
void |
setTimeoutCheckInterval(int timeInterval)
Sets the timeoutCheckInterval (in seconds).
|
void |
setTimeToLiveConnectionTimeout(int timeToLiveConnectionTimeout)
Sets the maximum time (in seconds) a connection may remain in-use.
|
void |
setURL(java.lang.String url)
Sets the URL that the data source uses to obtain connections to the
database.
|
void |
setUser(java.lang.String user)
Sets the user name with which connections have to be obtained.
|
void |
setValidateConnectionOnBorrow(boolean validateConnectionOnBorrow)
Sets whether or not a connection being borrowed should first be
validated.
|
void |
startPool()
This helper method gets all the pool properties for pool initialization,
creates a pool and starts it.
|
static java.lang.Object |
toBasicType(java.lang.String value,
java.lang.String type) |
void |
unregisterConnectionInitializationCallback()
Unregisters the connection initialization callback on this pool.
|
<T> T |
unwrap(java.lang.Class<T> iface)
Since this class is not a wrapper, just check to see if this implements the
requested interface.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateShardingKeyBuilderpublic static final java.lang.String SECRET_STORE_CONNECT
public static final java.lang.String SECRET_STORE_USERNAME
public static final java.lang.String SECRET_STORE_PASSWORD
public static final java.lang.String SECRET_STORE_DEFAULT_USERNAME
public static final java.lang.String SECRET_STORE_DEFAULT_PASSWORD
protected java.lang.String m_connectionFactoryClassName
protected java.lang.Object m_connectionFactory
protected transient oracle.ucp.jdbc.JDBCConnectionPool m_cp
public void startPool()
throws java.sql.SQLException
java.sql.SQLException - if a database-access error occurs.protected void createPoolWithDefaultProperties()
throws java.sql.SQLException
java.sql.SQLExceptionpublic UniversalConnectionPool createUniversalConnectionPool() throws java.sql.SQLException
This method should not register the created pool instance with the Universal Connection Pool Manager. The method createConnectionPool on the UniversalConnectionPoolManager is responsible for that.
This method is intended to be used in association with a UniversalConnectionPoolManager or MBean. Do not directly invoke this method from an instance of this class.
createUniversalConnectionPool in interface UniversalConnectionPoolAdapterjava.sql.SQLException - If any error occurs during the process of connection pool
creation.UniversalConnectionPoolManagerpublic void reconfigureDataSource(java.util.Properties configuration)
throws java.sql.SQLException
user, password,
description, serviceName, pdbRoles.reconfigureDataSource in interface PoolDataSourceconfiguration - the configuration inputjava.sql.SQLException - If an error occurs while configuring the data source.public UniversalConnectionPoolMBean createUniversalConnectionPoolMBean() throws java.sql.SQLException
This method should not register the created pool MBean with the MBean server. The operation createConnectionPool on the UniversalConnectionPoolManagerMBean is responsible for that.
createUniversalConnectionPoolMBean in interface UniversalConnectionPoolAdapterjava.sql.SQLException - If any error occurs during the process of connection pool
creation.UniversalConnectionPoolManagerMBeanpublic java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLException - if a database-access error occurs.public java.sql.Connection getConnection(java.lang.String username,
java.lang.String password)
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourceusername - The database user on whose behalf the connection is
being made.password - The user's password.java.sql.SQLException - if a database-access error occurs.public java.sql.Connection getConnection(java.util.Properties labels)
throws java.sql.SQLException
getConnection in interface PoolDataSourcelabels - The requested connection labels.java.sql.SQLException - if a database-access error occurs.public java.sql.Connection getConnection(java.lang.String username,
java.lang.String password,
java.util.Properties labels)
throws java.sql.SQLException
getConnection in interface PoolDataSourceusername - The database user on whose behalf the connection is being made.password - The user's password.labels - The requested connection labels.java.sql.SQLException - if a database-access error occurs.public java.io.PrintWriter getLogWriter()
throws java.sql.SQLException
getLogWriter in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic void setLogWriter(java.io.PrintWriter logWriter)
throws java.sql.SQLException
setLogWriter in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic void setLoginTimeout(int seconds)
throws java.sql.SQLException
setLoginTimeout in interface javax.sql.CommonDataSourceseconds - timeoutjava.sql.SQLException - in case of negative valuepublic int getLoginTimeout()
getLoginTimeout in interface javax.sql.CommonDataSourcepublic java.lang.String getUser()
PoolDataSourcegetUser in interface PoolDataSourcepublic void setUser(java.lang.String user)
throws java.sql.SQLException
PoolDataSourcesetUser in interface PoolDataSourceuser - Username to be set.java.sql.SQLExceptionpublic java.lang.String getPassword()
PoolDataSourcegetPassword in interface PoolDataSourcepublic void setPassword(java.lang.String password)
throws java.sql.SQLException
PoolDataSourcesetPassword in interface PoolDataSourcepassword - Password to be set.java.sql.SQLExceptionpublic java.lang.String getURL()
PoolDataSourcegetURL in interface PoolDataSourcepublic void setURL(java.lang.String url)
throws java.sql.SQLException
PoolDataSourcesetURL in interface PoolDataSourceurl - URL to be set.java.sql.SQLExceptionpublic void setServerName(java.lang.String serverName)
throws java.sql.SQLException
setServerName in interface PoolDataSourceserverName - Database server name to be set.java.sql.SQLExceptionpublic java.lang.String getServerName()
getServerName in interface PoolDataSourcepublic void setPortNumber(int portNumber)
throws java.sql.SQLException
setPortNumber in interface PoolDataSourceportNumber - Database port number to be set.java.sql.SQLExceptionpublic int getPortNumber()
getPortNumber in interface PoolDataSourcepublic void setDatabaseName(java.lang.String databaseName)
throws java.sql.SQLException
setDatabaseName in interface PoolDataSourcedatabaseName - Database name to be set.java.sql.SQLExceptionpublic java.lang.String getDatabaseName()
getDatabaseName in interface PoolDataSourcepublic void setDataSourceName(java.lang.String dataSourceName)
throws java.sql.SQLException
setDataSourceName in interface PoolDataSourcedataSourceName - data source name to be set.java.sql.SQLExceptionpublic java.lang.String getDataSourceName()
getDataSourceName in interface PoolDataSourcepublic void setDescription(java.lang.String description)
throws java.sql.SQLException
setDescription in interface PoolDataSourcedescription - data source description to be set.java.sql.SQLExceptionpublic java.lang.String getDescription()
getDescription in interface PoolDataSourcepublic void setNetworkProtocol(java.lang.String networkProtocol)
throws java.sql.SQLException
setNetworkProtocol in interface PoolDataSourcenetworkProtocol - datasource networkProtocol to be set.java.sql.SQLExceptionpublic java.lang.String getNetworkProtocol()
getNetworkProtocol in interface PoolDataSourcepublic void setRoleName(java.lang.String roleName)
throws java.sql.SQLException
setRoleName in interface PoolDataSourceroleName - datasource role name to be set.java.sql.SQLExceptionpublic java.lang.String getRoleName()
getRoleName in interface PoolDataSourcepublic void setInitialPoolSize(int initialPoolSize)
throws java.sql.SQLException
PoolDataSource
The range of valid values is 0 to Integer.MAX_VALUE. It is
illegal to set this to a value greater than the maximum pool size.
Defaults to 0.
setInitialPoolSize in interface PoolDataSourceinitialPoolSize - the initial pool size.java.sql.SQLExceptionpublic int getInitialPoolSize()
PoolDataSourcegetInitialPoolSize in interface PoolDataSourcepublic void setMinPoolSize(int minPoolSize)
throws java.sql.SQLException
PoolDataSource
The range of valid values is 0 to Integer.MAX_VALUE. It is
illegal to set this to a value greater than the maximum pool size.
Defaults to 0.
setMinPoolSize in interface PoolDataSourceminPoolSize - The minimum number of connections.java.sql.SQLExceptionpublic int getMinPoolSize()
PoolDataSourcegetMinPoolSize in interface PoolDataSourcepublic void setMaxPoolSize(int maxPoolSize)
throws java.sql.SQLException
PoolDataSource
The range of valid values is 1 to Integer.MAX_VALUE.
Defaults to Integer.MAX_VALUE.
setMaxPoolSize in interface PoolDataSourcemaxPoolSize - The maximum number of connections.java.sql.SQLExceptionpublic int getMaxPoolSize()
PoolDataSourcegetMaxPoolSize in interface PoolDataSourcepublic int getMaxConnectionsPerService()
PoolDataSourcegetMaxConnectionsPerService in interface PoolDataSourcepublic void setInactiveConnectionTimeout(int inactivityTimeout)
throws java.sql.SQLException
PoolDataSource
The range of valid values is 0 to Integer.MAX_VALUE.
Defaults to 0.
Setting the value to 0 disables inactive connection timeout processing.
setInactiveConnectionTimeout in interface PoolDataSourceinactivityTimeout - The inactive connection timeout in seconds.java.sql.SQLExceptionpublic int getInactiveConnectionTimeout()
PoolDataSourcegetInactiveConnectionTimeout in interface PoolDataSourcepublic void setConnectionWaitTimeout(int waitTimeout)
throws java.sql.SQLException
PoolDataSource
The range of valid values is 0 to Integer.MAX_VALUE.
Defaults to 3.
Setting the value to 0 disables connection wait timeout processing.
setConnectionWaitTimeout in interface PoolDataSourcewaitTimeout - The amount of time to wait.java.sql.SQLExceptionpublic int getConnectionWaitTimeout()
PoolDataSourcegetConnectionWaitTimeout in interface PoolDataSourcepublic void setTimeToLiveConnectionTimeout(int timeToLiveConnectionTimeout)
throws java.sql.SQLException
PoolDataSource
The range of valid values is 0 to Integer.MAX_VALUE.
Defaults to 0.
Setting the value to 0 disables time-to-live connection timeout processing.
setTimeToLiveConnectionTimeout in interface PoolDataSourcetimeToLiveConnectionTimeout - The maximum time (in seconds) a
used connection may be active.java.sql.SQLExceptionpublic int getTimeToLiveConnectionTimeout()
PoolDataSourcegetTimeToLiveConnectionTimeout in interface PoolDataSourcepublic int getAbandonedConnectionTimeout()
PoolDataSourcegetAbandonedConnectionTimeout in interface PoolDataSourcepublic void setAbandonedConnectionTimeout(int abandonedConnectionTimeout)
throws java.sql.SQLException
PoolDataSource
The range of valid values is 0 to Integer.MAX_VALUE.
Defaults to 0.
Setting the value to 0 disables abandoned connection timeout.
setAbandonedConnectionTimeout in interface PoolDataSourceabandonedConnectionTimeout - The value of how long a connection
has not been used before it is
abandoned (in seconds).java.sql.SQLExceptionpublic void setTimeoutCheckInterval(int timeInterval)
throws java.sql.SQLException
PoolDataSource
The range of valid values is 0 to Integer.MAX_VALUE.
Defaults to 30.
Setting the value to 0 disables all connection timeout processing.
setTimeoutCheckInterval in interface PoolDataSourcetimeInterval - The timeInterval (in seconds) between checks
to enforce the timeout properties.java.sql.SQLExceptionpublic int getTimeoutCheckInterval()
PoolDataSourcegetTimeoutCheckInterval in interface PoolDataSourcetimeInterval (in seconds) between
checks to enforce the timeout properties.public void setFastConnectionFailoverEnabled(boolean failoverEnabled)
throws java.sql.SQLException
PoolDataSourcesetFastConnectionFailoverEnabled in interface PoolDataSourcefailoverEnabled - true if Fast Connection Failover is
enabled; false if not.java.sql.SQLExceptionpublic boolean getFastConnectionFailoverEnabled()
PoolDataSourcegetFastConnectionFailoverEnabled in interface PoolDataSourcetrue if Fast Connection Failover is enabled;
false if not.public java.lang.String getConnectionFactoryClassName()
PoolDataSourcegetConnectionFactoryClassName in interface PoolDataSourcepublic void setConnectionFactoryClassName(java.lang.String factoryClassName)
throws java.sql.SQLException
PoolDataSourcePoolDataSource to operate.setConnectionFactoryClassName in interface PoolDataSourcefactoryClassName - Connection factory class name for obtaining
physical connections.java.sql.SQLExceptionpublic void setMaxStatements(int maxStatements)
throws java.sql.SQLException
setMaxStatements in interface PoolDataSourcemaxStatements - maximum number of statements to be pooled.java.sql.SQLException - Exception occurred during the process of setting
maximum statements that may be pooled on a connection.public int getMaxStatements()
getMaxStatements in interface PoolDataSourcepublic void setMaxIdleTime(int idleTime)
throws java.sql.SQLException
setMaxIdleTime in interface PoolDataSourceidleTime - Idle timeout value in seconds.java.sql.SQLExceptionpublic int getMaxIdleTime()
getMaxIdleTime in interface PoolDataSourcepublic void setPropertyCycle(int propertyCycle)
throws java.sql.SQLException
setPropertyCycle in interface PoolDataSourcepropertyCycle - Time interval in seconds to enforce
connection pool timeout properties.java.sql.SQLExceptionpublic int getPropertyCycle()
getPropertyCycle in interface PoolDataSourcepublic void setConnectionPoolName(java.lang.String connectionPoolName)
throws java.sql.SQLException
setConnectionPoolName in interface PoolDataSourceconnectionPoolName - Name of connection pool.java.sql.SQLExceptionpublic java.lang.String getConnectionPoolName()
getConnectionPoolName in interface PoolDataSourcepublic void setValidateConnectionOnBorrow(boolean validateConnectionOnBorrow)
throws java.sql.SQLException
setValidateConnectionOnBorrow in interface PoolDataSourcevalidateConnectionOnBorrow - Whether or not a connection
being borrowed should first be
validated.java.sql.SQLExceptionpublic boolean getValidateConnectionOnBorrow()
getValidateConnectionOnBorrow in interface PoolDataSourcepublic void setSQLForValidateConnection(java.lang.String SQLString)
throws java.sql.SQLException
setSQLForValidateConnection in interface PoolDataSourceSQLString - The SQL string used for connection validation.java.sql.SQLExceptionpublic java.lang.String getSQLForValidateConnection()
getSQLForValidateConnection in interface PoolDataSourcepublic int getConnectionHarvestTriggerCount()
getConnectionHarvestTriggerCount in interface PoolDataSourcepublic void setConnectionHarvestTriggerCount(int connectionHarvestTriggerCount)
throws java.sql.SQLException
setConnectionHarvestTriggerCount in interface PoolDataSourceconnectionHarvestTriggerCount - The number of available
connections at which the
connection pool's connection
harvesting will occur.java.sql.SQLExceptionpublic int getConnectionHarvestMaxCount()
getConnectionHarvestMaxCount in interface PoolDataSourcepublic void setConnectionHarvestMaxCount(int connectionHarvestMaxCount)
throws java.sql.SQLException
setConnectionHarvestMaxCount in interface PoolDataSourceconnectionHarvestMaxCount - the maximum number of connections
that may be harvested when the
connection harvesting occurs.java.sql.SQLExceptionpublic long getMaxConnectionReuseTime()
getMaxConnectionReuseTime in interface PoolDataSourcepublic void setMaxConnectionReuseTime(long maxConnectionReuseTime)
throws java.sql.SQLException
setMaxConnectionReuseTime in interface PoolDataSourceconnection - reuse time (in seconds),
0 value means that the feature is disabled.java.sql.SQLExceptionpublic int getMaxConnectionReuseCount()
getMaxConnectionReuseCount in interface PoolDataSourcepublic void setMaxConnectionReuseCount(int maxConnectionReuseCount)
throws java.sql.SQLException
setMaxConnectionReuseCount in interface PoolDataSourceconnection - reuse count,
0 value means that the feature is disabled.java.sql.SQLExceptionpublic int getAvailableConnectionsCount()
getAvailableConnectionsCount in interface PoolDataSourcepublic int getBorrowedConnectionsCount()
getBorrowedConnectionsCount in interface PoolDataSourcepublic java.lang.String getONSConfiguration()
throws java.sql.SQLException
getONSConfiguration in interface PoolDataSourcejava.sql.SQLExceptionpublic void setONSConfiguration(java.lang.String onsConfigStr)
throws java.sql.SQLException
An example ONS configuration string:
"nodes=host1:4200,host2:4200\nwalletfile=wfile\nwalletpassword=wpwd"
This is used primarily by Fast Connection Failover and Runtime Load Balancing.
setONSConfiguration in interface PoolDataSourceonsConfigStr - The configuration string for remote ONS
subscription.java.sql.SQLExceptionpublic void registerConnectionLabelingCallback(ConnectionLabelingCallback cbk) throws java.sql.SQLException
registerConnectionLabelingCallback in interface PoolDataSourcecbk - The ConnectionLabelingCallback object to be registered.java.sql.SQLException - If there is a callback already
registered with the pool.public void removeConnectionLabelingCallback()
throws java.sql.SQLException
removeConnectionLabelingCallback in interface PoolDataSourcejava.sql.SQLException - If callback removal fails.public void registerConnectionAffinityCallback(ConnectionAffinityCallback cbk) throws java.sql.SQLException
registerConnectionAffinityCallback in interface PoolDataSourcecbk - Affinity Callback object that must be registered.java.sql.SQLException - If callback registration fails.public void removeConnectionAffinityCallback()
throws java.sql.SQLException
removeConnectionAffinityCallback in interface PoolDataSourcejava.sql.SQLException - If callback removal fails.public JDBCConnectionPoolStatistics getStatistics()
getStatistics in interface PoolDataSourcepublic java.lang.String getServiceName()
getServiceName in interface PoolDataSourcepublic java.util.Properties getConnectionProperties()
getConnectionProperties in interface PoolDataSourcepublic java.lang.String getConnectionProperty(java.lang.String propertyName)
getConnectionProperty in interface PoolDataSourcepropertyName - The name of the specified property.public void setConnectionProperty(java.lang.String name,
java.lang.String value)
throws java.sql.SQLException
oracle.jdbc.pool.OracleDataSource in the Oracle
JDBC driver.setConnectionProperty in interface PoolDataSourcename - The name of the connection property to be set on
the connection factory class.value - The value of the connection property to be set on
the connection factory class.java.sql.SQLException - If any exception occurred while setting the connection
property.setConnectionFactoryPropertiespublic void setConnectionProperties(java.util.Properties connectionProperties)
throws java.sql.SQLException
oracle.jdbc.pool.OracleDataSource in the Oracle
JDBC driver.setConnectionProperties in interface PoolDataSourceconnectionProperties - Connection properties to be set on the connection factory class.java.sql.SQLException - If any exception occurred while setting the connection
properties.setConnectionFactoryPropertiespublic java.util.Properties getConnectionFactoryProperties()
getConnectionFactoryProperties in interface PoolDataSourcepublic java.lang.String getConnectionFactoryProperty(java.lang.String propertyName)
getConnectionFactoryProperty in interface PoolDataSourcepropertyName - The name of the specified property.public void setConnectionFactoryProperty(java.lang.String name,
java.lang.String value)
throws java.sql.SQLException
For connection factories that implement java.sql.Driver,
the connection factory property specified here will be assumed
as a connection property.
For DataSource connection factories, the property specified here will be assumed as a DataSource property.
setConnectionFactoryProperty in interface PoolDataSourcename - The name of the connection factory property to be set
on the connection factory class.value - The value of the connection factory property to be set
on the connection factory class.java.sql.SQLException - If any exception occurred while setting the connection factory
property.java.lang.IllegalArgumentException - If the property name or value is invalid.public void setConnectionFactoryProperties(java.util.Properties factoryProperties)
throws java.sql.SQLException
For connection factories that implement java.sql.Driver,
the connection factory properties specified here will be assumed
as the connection properties.
For DataSource connection factories, the properties specified here will be assumed as the DataSource properties.
setConnectionFactoryProperties in interface PoolDataSourcefactoryProperties - Connection factory properties to be set on the connection
factory class.java.sql.SQLException - If any exception occurred while setting the connection factory
properties.java.lang.IllegalArgumentException - If factoryProperties is empty.public static final java.lang.Object toBasicType(java.lang.String value,
java.lang.String type)
public javax.naming.Reference getReference()
throws javax.naming.NamingException
getReference in interface javax.naming.Referenceablejavax.naming.NamingExceptionpublic java.lang.Object getObjectInstance(java.lang.Object refObj,
javax.naming.Name name,
javax.naming.Context nameCtx,
java.util.Hashtable env)
throws java.lang.Exception
getObjectInstance in interface javax.naming.spi.ObjectFactoryjava.lang.Exceptionpublic boolean isWrapperFor(java.lang.Class<?> iface)
throws java.sql.SQLException
isWrapperFor in interface java.sql.Wrapperiface - Requested interface.java.sql.SQLException - If the argument is not an interface.public <T> T unwrap(java.lang.Class<T> iface)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperiface - Requested interface.java.sql.SQLException - If this does not implement the arg or the arg is not an interface.public void registerConnectionInitializationCallback(ConnectionInitializationCallback cbk) throws java.sql.SQLException
registerConnectionInitializationCallback in interface PoolDataSourcecbk - The ConnectionInitializationCallback
object to be registered.java.sql.SQLException - If there is a callback already
registered with the pool.public void unregisterConnectionInitializationCallback()
throws java.sql.SQLException
unregisterConnectionInitializationCallback in interface PoolDataSourcejava.sql.SQLException - If callback removal fails.public ConnectionInitializationCallback getConnectionInitializationCallback()
getConnectionInitializationCallback in interface PoolDataSourceConnectionInitializationCallback,
or null if there is no callback registered.public int getConnectionLabelingHighCost()
PoolDataSourcegetConnectionLabelingHighCost in interface PoolDataSourcesetConnectionLabelingHighCostpublic void setConnectionLabelingHighCost(int highCost)
throws java.sql.SQLException
PoolDataSourcecost(Properties, Properties)
method in ConnectionLabelingCallback to find a connection in the pool
for a request. When this property is set, connections with a
cost value equal to or greater than the property value are
considered "high-cost" connections.
The default value is Integer.MAX_VALUE.setConnectionLabelingHighCost in interface PoolDataSourcehighCost - The cost value that identifies a connection as
"high-cost" for connection labeling.java.sql.SQLException - If an exception occurs while setting the cost.public int getConnectionRepurposeThreshold()
PoolDataSourcegetConnectionRepurposeThreshold in interface PoolDataSourcepublic void setConnectionRepurposeThreshold(int threshold)
throws java.sql.SQLException
PoolDataSourcesetConnectionRepurposeThreshold in interface PoolDataSourcethreshold - connection repurpose threshold to set.java.sql.SQLException - If any exception occurs while setting the threshold.getConnectionRepurposeThresholdpublic int getHighCostConnectionReuseThreshold()
PoolDataSourcegetHighCostConnectionReuseThreshold in interface PoolDataSourcesetConnectionLabelingHighCost,
setHighCostConnectionReuseThresholdpublic void setHighCostConnectionReuseThreshold(int threshold)
throws java.sql.SQLException
PoolDataSourcesetHighCostConnectionReuseThreshold in interface PoolDataSourcethreshold - The high-cost connection reuse threshold to set.java.sql.SQLException - If any exception occurs while setting the threshold.public java.util.Properties getPdbRoles()
getPdbRoles in interface PoolDataSourcesetPdbRolespublic int getSecondsToTrustIdleConnection()
setSecondsToTrustIdleConnection().getSecondsToTrustIdleConnection in interface PoolDataSourcepublic void setSecondsToTrustIdleConnection(int secondsToTrustIdleConnection)
throws java.sql.SQLException
setValidateConnectionOnBorrow(boolean). When set to any
positive value, a connection validation during the checkout is skipped if
the connection was successfully used and returned to the pool within the
time specified for secondsToTrustIdleConnection. Default value is set to 0
seconds which means that the feature is disabled.setSecondsToTrustIdleConnection in interface PoolDataSourcesecondsToTrustIdleConnection - The value of how long a connection can be trusted to skip
connectionValidationOnBorrowjava.sql.SQLExceptionpublic UCPConnectionBuilder createConnectionBuilder()
PoolDataSourcecreateConnectionBuilder in interface PoolDataSourcePoolDataSource.createConnectionBuilder()public java.util.logging.Logger getParentLogger()
throws java.sql.SQLFeatureNotSupportedException
getParentLogger in interface javax.sql.CommonDataSourcejava.sql.SQLFeatureNotSupportedExceptionCommonDataSource.getParentLogger()public int getQueryTimeout()
getQueryTimeout in interface PoolDataSourcepublic void setQueryTimeout(int queryTimeout)
throws java.sql.SQLException
setQueryTimeout in interface PoolDataSourcequeryTimeout - in secondsjava.sql.SQLExceptionpublic int getMaxConnectionsPerShard()
getMaxConnectionsPerShard in interface PoolDataSourcepublic void setMaxConnectionsPerShard(int maxConnectionsPerShard)
throws java.sql.SQLException
setMaxConnectionsPerShard in interface PoolDataSourcemaxConnectionsPerShard - The max number of connections that can be created per shardjava.sql.SQLException - if there is an any exception while setting this parameterprotected void ilogFinest(java.util.logging.Logger logger,
java.lang.Class cls,
java.lang.reflect.Executable method,
java.lang.Object receiver,
java.lang.String message)
protected void ilogFine(java.util.logging.Logger logger,
java.lang.Class cls,
java.lang.reflect.Executable method,
java.lang.Object receiver,
java.lang.String message)
protected void ilogWarning(java.util.logging.Logger logger,
java.lang.Class cls,
java.lang.reflect.Executable method,
java.lang.Object receiver,
java.lang.String message)
protected void ilogSevere(java.util.logging.Logger logger,
java.lang.Class cls,
java.lang.reflect.Executable method,
java.lang.Object receiver,
java.lang.String message)
protected void ilogThrowing(java.util.logging.Logger logger,
java.lang.Class cls,
java.lang.reflect.Executable method,
java.lang.Object receiver,
java.lang.Throwable throwable)