public class PoolDataSourceImpl extends Object implements PoolDataSource, Serializable, Referenceable, ObjectFactory, UniversalConnectionPoolAdapter
| Modifier and Type | Field and Description |
|---|---|
protected Object |
m_connectionFactory |
protected String |
m_connectionFactoryClassName |
protected JDBCConnectionPool |
m_cp |
static String |
SECRET_STORE_CONNECT |
static String |
SECRET_STORE_DEFAULT_PASSWORD |
static String |
SECRET_STORE_DEFAULT_USERNAME |
static String |
SECRET_STORE_PASSWORD |
static 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.
|
Connection |
getConnection()
Attempts to obtain a database connection.
|
Connection |
getConnection(Properties labels)
Attempts to obtain a database connection with the requested
connection labels.
|
Connection |
getConnection(String username,
String password)
Attempts to obtain a database connection.
|
Connection |
getConnection(String username,
String password,
Properties labels)
Attempts to obtain a database connection with the requested connection
labels.
|
String |
getConnectionFactoryClassName()
Gets the Connection Factory class name.
|
Properties |
getConnectionFactoryProperties()
Gets the connection factory properties that are set on this
data source.
|
String |
getConnectionFactoryProperty(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.
|
String |
getConnectionPoolName()
Gets the connection pool name.
|
Properties |
getConnectionProperties()
Gets the connection properties that are set on this data source.
|
String |
getConnectionProperty(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.
|
String |
getDatabaseName()
Gets the database name.
|
String |
getDataSourceName()
Gets the data source name.
|
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.
|
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.
|
String |
getNetworkProtocol()
Gets the datasource networkProtocol.
|
Object |
getObjectInstance(Object refObj,
Name name,
Context nameCtx,
Hashtable env) |
String |
getONSConfiguration()
Returns the ONS configuration string that is used for remote ONS
subscription, in the form specified in setONSConfiguration(String).
|
Logger |
getParentLogger() |
String |
getPassword()
Gets the Password for this data source.
|
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.
|
Reference |
getReference() |
String |
getRoleName()
Gets the datasource role name.
|
int |
getSecondsToTrustIdleConnection()
Gets the seconds To Trust Idle Connection value.
|
String |
getServerName()
Gets the database server name.
|
String |
getServiceName()
Gets the service name set on this data source
|
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.
|
String |
getURL()
Gets the URL for this data source.
|
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(Logger logger,
Class cls,
Executable method,
Object receiver,
String message) |
protected void |
ilogFinest(Logger logger,
Class cls,
Executable method,
Object receiver,
String message)
Helpers for writing into log and logWriter
|
protected void |
ilogSevere(Logger logger,
Class cls,
Executable method,
Object receiver,
String message) |
protected void |
ilogThrowing(Logger logger,
Class cls,
Executable method,
Object receiver,
Throwable throwable) |
protected void |
ilogWarning(Logger logger,
Class cls,
Executable method,
Object receiver,
String message) |
boolean |
isWrapperFor(Class<?> iface)
Since this class is not a wrapper, just check to see if this implements the
requested interface.
|
void |
reconfigureDataSource(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(String factoryClassName)
Sets the Connection Factory class name.
|
void |
setConnectionFactoryProperties(Properties factoryProperties)
Sets the connection factory properties on the connection factory.
|
void |
setConnectionFactoryProperty(String name,
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(String connectionPoolName)
Sets the connection pool name.
|
void |
setConnectionProperties(Properties connectionProperties)
Sets the connection properties on the connection factory.
|
void |
setConnectionProperty(String name,
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(String databaseName)
Sets the database name.
|
void |
setDataSourceName(String dataSourceName)
Sets the data source name.
|
void |
setDescription(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(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(String networkProtocol)
Sets the datasource networkProtocol.
|
void |
setONSConfiguration(String onsConfigStr)
Sets the configuration string used for remote ONS subscription.
|
void |
setPassword(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(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(String serverName)
Sets the database server name.
|
void |
setSQLForValidateConnection(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(String url)
Sets the URL that the data source uses to obtain connections to the
database.
|
void |
setUser(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 Object |
toBasicType(String value,
String type) |
void |
unregisterConnectionInitializationCallback()
Unregisters the connection initialization callback on this pool.
|
<T> T |
unwrap(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 String SECRET_STORE_CONNECT
public static final String SECRET_STORE_USERNAME
public static final String SECRET_STORE_PASSWORD
public static final String SECRET_STORE_DEFAULT_USERNAME
public static final String SECRET_STORE_DEFAULT_PASSWORD
protected String m_connectionFactoryClassName
protected Object m_connectionFactory
protected transient JDBCConnectionPool m_cp
public void startPool()
throws SQLException
SQLException - if a database-access error occurs.protected void createPoolWithDefaultProperties()
throws SQLException
SQLExceptionpublic UniversalConnectionPool createUniversalConnectionPool() throws SQLException
createUniversalConnectionPool in interface UniversalConnectionPoolAdapterSQLException - If any error occurs during the process of connection pool
creation.UniversalConnectionPoolManagerpublic void reconfigureDataSource(Properties configuration) throws SQLException
user, password,
description, serviceName, pdbRoles.reconfigureDataSource in interface PoolDataSourceconfiguration - the configuration inputSQLException - If an error occurs while configuring the data source.public UniversalConnectionPoolMBean createUniversalConnectionPoolMBean() throws SQLException
createUniversalConnectionPoolMBean in interface UniversalConnectionPoolAdapterSQLException - If any error occurs during the process of connection pool
creation.UniversalConnectionPoolManagerMBeanpublic Connection getConnection() throws SQLException
getConnection in interface DataSourceSQLException - if a database-access error occurs.public Connection getConnection(String username, String password) throws SQLException
getConnection in interface DataSourceusername - The database user on whose behalf the connection is
being made.password - The user's password.SQLException - if a database-access error occurs.public Connection getConnection(Properties labels) throws SQLException
getConnection in interface PoolDataSourcelabels - The requested connection labels.SQLException - if a database-access error occurs.public Connection getConnection(String username, String password, Properties labels) throws 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.SQLException - if a database-access error occurs.public PrintWriter getLogWriter() throws SQLException
getLogWriter in interface CommonDataSourceSQLExceptionpublic void setLogWriter(PrintWriter logWriter) throws SQLException
setLogWriter in interface CommonDataSourceSQLExceptionpublic void setLoginTimeout(int seconds)
throws SQLException
setLoginTimeout in interface CommonDataSourceseconds - timeoutSQLException - in case of negative valuepublic int getLoginTimeout()
getLoginTimeout in interface CommonDataSourcepublic String getUser()
PoolDataSourcegetUser in interface PoolDataSourcepublic void setUser(String user) throws SQLException
PoolDataSourcesetUser in interface PoolDataSourceuser - Username to be set.SQLExceptionpublic String getPassword()
PoolDataSourcegetPassword in interface PoolDataSourcepublic void setPassword(String password) throws SQLException
PoolDataSourcesetPassword in interface PoolDataSourcepassword - Password to be set.SQLExceptionpublic String getURL()
PoolDataSourcegetURL in interface PoolDataSourcepublic void setURL(String url) throws SQLException
PoolDataSourcesetURL in interface PoolDataSourceurl - URL to be set.SQLExceptionpublic void setServerName(String serverName) throws SQLException
setServerName in interface PoolDataSourceserverName - Database server name to be set.SQLExceptionpublic String getServerName()
getServerName in interface PoolDataSourcepublic void setPortNumber(int portNumber)
throws SQLException
setPortNumber in interface PoolDataSourceportNumber - Database port number to be set.SQLExceptionpublic int getPortNumber()
getPortNumber in interface PoolDataSourcepublic void setDatabaseName(String databaseName) throws SQLException
setDatabaseName in interface PoolDataSourcedatabaseName - Database name to be set.SQLExceptionpublic String getDatabaseName()
getDatabaseName in interface PoolDataSourcepublic void setDataSourceName(String dataSourceName) throws SQLException
setDataSourceName in interface PoolDataSourcedataSourceName - data source name to be set.SQLExceptionpublic String getDataSourceName()
getDataSourceName in interface PoolDataSourcepublic void setDescription(String description) throws SQLException
setDescription in interface PoolDataSourcedescription - data source description to be set.SQLExceptionpublic String getDescription()
getDescription in interface PoolDataSourcepublic void setNetworkProtocol(String networkProtocol) throws SQLException
setNetworkProtocol in interface PoolDataSourcenetworkProtocol - datasource networkProtocol to be set.SQLExceptionpublic String getNetworkProtocol()
getNetworkProtocol in interface PoolDataSourcepublic void setRoleName(String roleName) throws SQLException
setRoleName in interface PoolDataSourceroleName - datasource role name to be set.SQLExceptionpublic String getRoleName()
getRoleName in interface PoolDataSourcepublic void setInitialPoolSize(int initialPoolSize)
throws SQLException
PoolDataSourceInteger.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.SQLExceptionpublic int getInitialPoolSize()
PoolDataSourcegetInitialPoolSize in interface PoolDataSourcepublic void setMinPoolSize(int minPoolSize)
throws SQLException
PoolDataSourceInteger.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.SQLExceptionpublic int getMinPoolSize()
PoolDataSourcegetMinPoolSize in interface PoolDataSourcepublic void setMaxPoolSize(int maxPoolSize)
throws SQLException
PoolDataSourceInteger.MAX_VALUE.
Defaults to Integer.MAX_VALUE.setMaxPoolSize in interface PoolDataSourcemaxPoolSize - The maximum number of connections.SQLExceptionpublic int getMaxPoolSize()
PoolDataSourcegetMaxPoolSize in interface PoolDataSourcepublic int getMaxConnectionsPerService()
PoolDataSourcegetMaxConnectionsPerService in interface PoolDataSourcepublic void setInactiveConnectionTimeout(int inactivityTimeout)
throws SQLException
PoolDataSourceInteger.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.SQLExceptionpublic int getInactiveConnectionTimeout()
PoolDataSourcegetInactiveConnectionTimeout in interface PoolDataSourcepublic void setConnectionWaitTimeout(int waitTimeout)
throws SQLException
PoolDataSourceInteger.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.SQLExceptionpublic int getConnectionWaitTimeout()
PoolDataSourcegetConnectionWaitTimeout in interface PoolDataSourcepublic void setTimeToLiveConnectionTimeout(int timeToLiveConnectionTimeout)
throws SQLException
PoolDataSourceInteger.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.SQLExceptionpublic int getTimeToLiveConnectionTimeout()
PoolDataSourcegetTimeToLiveConnectionTimeout in interface PoolDataSourcepublic int getAbandonedConnectionTimeout()
PoolDataSourcegetAbandonedConnectionTimeout in interface PoolDataSourcepublic void setAbandonedConnectionTimeout(int abandonedConnectionTimeout)
throws SQLException
PoolDataSourceInteger.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).SQLExceptionpublic void setTimeoutCheckInterval(int timeInterval)
throws SQLException
PoolDataSourceInteger.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.SQLExceptionpublic int getTimeoutCheckInterval()
PoolDataSourcegetTimeoutCheckInterval in interface PoolDataSourcetimeInterval (in seconds) between
checks to enforce the timeout properties.public void setFastConnectionFailoverEnabled(boolean failoverEnabled)
throws SQLException
PoolDataSourcesetFastConnectionFailoverEnabled in interface PoolDataSourcefailoverEnabled - true if Fast Connection Failover is
enabled; false if not.SQLExceptionpublic boolean getFastConnectionFailoverEnabled()
PoolDataSourcegetFastConnectionFailoverEnabled in interface PoolDataSourcetrue if Fast Connection Failover is enabled;
false if not.public String getConnectionFactoryClassName()
PoolDataSourcegetConnectionFactoryClassName in interface PoolDataSourcepublic void setConnectionFactoryClassName(String factoryClassName) throws SQLException
PoolDataSourcePoolDataSource to operate.setConnectionFactoryClassName in interface PoolDataSourcefactoryClassName - Connection factory class name for obtaining
physical connections.SQLExceptionpublic void setMaxStatements(int maxStatements)
throws SQLException
setMaxStatements in interface PoolDataSourcemaxStatements - maximum number of statements to be pooled.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 SQLException
setMaxIdleTime in interface PoolDataSourceidleTime - Idle timeout value in seconds.SQLExceptionpublic int getMaxIdleTime()
getMaxIdleTime in interface PoolDataSourcepublic void setPropertyCycle(int propertyCycle)
throws SQLException
setPropertyCycle in interface PoolDataSourcepropertyCycle - Time interval in seconds to enforce
connection pool timeout properties.SQLExceptionpublic int getPropertyCycle()
getPropertyCycle in interface PoolDataSourcepublic void setConnectionPoolName(String connectionPoolName) throws SQLException
setConnectionPoolName in interface PoolDataSourceconnectionPoolName - Name of connection pool.SQLExceptionpublic String getConnectionPoolName()
getConnectionPoolName in interface PoolDataSourcepublic void setValidateConnectionOnBorrow(boolean validateConnectionOnBorrow)
throws SQLException
setValidateConnectionOnBorrow in interface PoolDataSourcevalidateConnectionOnBorrow - Whether or not a connection
being borrowed should first be
validated.SQLExceptionpublic boolean getValidateConnectionOnBorrow()
getValidateConnectionOnBorrow in interface PoolDataSourcepublic void setSQLForValidateConnection(String SQLString) throws SQLException
setSQLForValidateConnection in interface PoolDataSourceSQLString - The SQL string used for connection validation.SQLExceptionpublic String getSQLForValidateConnection()
getSQLForValidateConnection in interface PoolDataSourcepublic int getConnectionHarvestTriggerCount()
getConnectionHarvestTriggerCount in interface PoolDataSourcepublic void setConnectionHarvestTriggerCount(int connectionHarvestTriggerCount)
throws SQLException
setConnectionHarvestTriggerCount in interface PoolDataSourceconnectionHarvestTriggerCount - The number of available
connections at which the
connection pool's connection
harvesting will occur.SQLExceptionpublic int getConnectionHarvestMaxCount()
getConnectionHarvestMaxCount in interface PoolDataSourcepublic void setConnectionHarvestMaxCount(int connectionHarvestMaxCount)
throws SQLException
setConnectionHarvestMaxCount in interface PoolDataSourceconnectionHarvestMaxCount - the maximum number of connections
that may be harvested when the
connection harvesting occurs.SQLExceptionpublic long getMaxConnectionReuseTime()
getMaxConnectionReuseTime in interface PoolDataSourcepublic void setMaxConnectionReuseTime(long maxConnectionReuseTime)
throws SQLException
setMaxConnectionReuseTime in interface PoolDataSourceconnection - reuse time (in seconds),
0 value means that the feature is disabled.SQLExceptionpublic int getMaxConnectionReuseCount()
getMaxConnectionReuseCount in interface PoolDataSourcepublic void setMaxConnectionReuseCount(int maxConnectionReuseCount)
throws SQLException
setMaxConnectionReuseCount in interface PoolDataSourceconnection - reuse count,
0 value means that the feature is disabled.SQLExceptionpublic int getAvailableConnectionsCount()
getAvailableConnectionsCount in interface PoolDataSourcepublic int getBorrowedConnectionsCount()
getBorrowedConnectionsCount in interface PoolDataSourcepublic String getONSConfiguration() throws SQLException
getONSConfiguration in interface PoolDataSourceSQLExceptionpublic void setONSConfiguration(String onsConfigStr) throws SQLException
"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.SQLExceptionpublic void registerConnectionLabelingCallback(ConnectionLabelingCallback cbk) throws SQLException
registerConnectionLabelingCallback in interface PoolDataSourcecbk - The ConnectionLabelingCallback object to be registered.SQLException - If there is a callback already
registered with the pool.public void removeConnectionLabelingCallback()
throws SQLException
removeConnectionLabelingCallback in interface PoolDataSourceSQLException - If callback removal fails.public void registerConnectionAffinityCallback(ConnectionAffinityCallback cbk) throws SQLException
registerConnectionAffinityCallback in interface PoolDataSourcecbk - Affinity Callback object that must be registered.SQLException - If callback registration fails.public void removeConnectionAffinityCallback()
throws SQLException
removeConnectionAffinityCallback in interface PoolDataSourceSQLException - If callback removal fails.public JDBCConnectionPoolStatistics getStatistics()
getStatistics in interface PoolDataSourcepublic String getServiceName()
getServiceName in interface PoolDataSourcepublic Properties getConnectionProperties()
getConnectionProperties in interface PoolDataSourcepublic String getConnectionProperty(String propertyName)
getConnectionProperty in interface PoolDataSourcepropertyName - The name of the specified property.public void setConnectionProperty(String name, String value) throws 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.SQLException - If any exception occurred while setting the connection
property.setConnectionFactoryPropertiespublic void setConnectionProperties(Properties connectionProperties) throws SQLException
oracle.jdbc.pool.OracleDataSource in the Oracle
JDBC driver.setConnectionProperties in interface PoolDataSourceconnectionProperties - Connection properties to be set on the connection factory class.SQLException - If any exception occurred while setting the connection
properties.setConnectionFactoryPropertiespublic Properties getConnectionFactoryProperties()
getConnectionFactoryProperties in interface PoolDataSourcepublic String getConnectionFactoryProperty(String propertyName)
getConnectionFactoryProperty in interface PoolDataSourcepropertyName - The name of the specified property.public void setConnectionFactoryProperty(String name, String value) throws SQLException
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.SQLException - If any exception occurred while setting the connection factory
property.IllegalArgumentException - If the property name or value is invalid.public void setConnectionFactoryProperties(Properties factoryProperties) throws SQLException
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.SQLException - If any exception occurred while setting the connection factory
properties.IllegalArgumentException - If factoryProperties is empty.public Reference getReference() throws NamingException
getReference in interface ReferenceableNamingExceptionpublic Object getObjectInstance(Object refObj, Name name, Context nameCtx, Hashtable env) throws Exception
getObjectInstance in interface ObjectFactoryExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface Wrapperiface - Requested interface.SQLException - If the argument is not an interface.public <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface Wrapperiface - Requested interface.SQLException - If this does not implement the arg or the arg is not an interface.public void registerConnectionInitializationCallback(ConnectionInitializationCallback cbk) throws SQLException
registerConnectionInitializationCallback in interface PoolDataSourcecbk - The ConnectionInitializationCallback
object to be registered.SQLException - If there is a callback already
registered with the pool.public void unregisterConnectionInitializationCallback()
throws SQLException
unregisterConnectionInitializationCallback in interface PoolDataSourceSQLException - 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 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.SQLException - If an exception occurs while setting the cost.public int getConnectionRepurposeThreshold()
PoolDataSourcegetConnectionRepurposeThreshold in interface PoolDataSourcepublic void setConnectionRepurposeThreshold(int threshold)
throws SQLException
PoolDataSourcesetConnectionRepurposeThreshold in interface PoolDataSourcethreshold - connection repurpose threshold to set.SQLException - If any exception occurs while setting the threshold.getConnectionRepurposeThresholdpublic int getHighCostConnectionReuseThreshold()
PoolDataSourcegetHighCostConnectionReuseThreshold in interface PoolDataSourcesetConnectionLabelingHighCost,
setHighCostConnectionReuseThresholdpublic void setHighCostConnectionReuseThreshold(int threshold)
throws SQLException
PoolDataSourcesetHighCostConnectionReuseThreshold in interface PoolDataSourcethreshold - The high-cost connection reuse threshold to set.SQLException - If any exception occurs while setting the threshold.public Properties getPdbRoles()
getPdbRoles in interface PoolDataSourcesetPdbRolespublic int getSecondsToTrustIdleConnection()
setSecondsToTrustIdleConnection().getSecondsToTrustIdleConnection in interface PoolDataSourcepublic void setSecondsToTrustIdleConnection(int secondsToTrustIdleConnection)
throws 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
connectionValidationOnBorrowSQLExceptionpublic UCPConnectionBuilder createConnectionBuilder()
PoolDataSourcecreateConnectionBuilder in interface PoolDataSourcePoolDataSource.createConnectionBuilder()public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface CommonDataSourceSQLFeatureNotSupportedExceptionCommonDataSource.getParentLogger()public int getQueryTimeout()
getQueryTimeout in interface PoolDataSourcepublic void setQueryTimeout(int queryTimeout)
throws SQLException
setQueryTimeout in interface PoolDataSourcequeryTimeout - in secondsSQLExceptionpublic int getMaxConnectionsPerShard()
getMaxConnectionsPerShard in interface PoolDataSourcepublic void setMaxConnectionsPerShard(int maxConnectionsPerShard)
throws SQLException
setMaxConnectionsPerShard in interface PoolDataSourcemaxConnectionsPerShard - The max number of connections that can be created per shardSQLException - if there is an any exception while setting this parameterprotected void ilogFinest(Logger logger, Class cls, Executable method, Object receiver, String message)
protected void ilogFine(Logger logger, Class cls, Executable method, Object receiver, String message)
protected void ilogWarning(Logger logger, Class cls, Executable method, Object receiver, String message)
protected void ilogSevere(Logger logger, Class cls, Executable method, Object receiver, String message)
protected void ilogThrowing(Logger logger, Class cls, Executable method, Object receiver, Throwable throwable)
Copyright © 2008, 2016, Oracle. All rights reserved.