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) |
static boolean |
isSetOnceProperty(String key)
Authentication kays to enforce to be set up once per a single pool data source
|
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, wait
createShardingKeyBuilder
public 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
SQLException
public UniversalConnectionPool createUniversalConnectionPool() throws SQLException
createUniversalConnectionPool
in interface UniversalConnectionPoolAdapter
SQLException
- If any error occurs during the process of connection pool
creation.UniversalConnectionPoolManager
public void reconfigureDataSource(Properties configuration) throws SQLException
user
, password
,
description
, serviceName
, pdbRoles
.reconfigureDataSource
in interface PoolDataSource
configuration
- the configuration inputSQLException
- If an error occurs while configuring the data source.public UniversalConnectionPoolMBean createUniversalConnectionPoolMBean() throws SQLException
createUniversalConnectionPoolMBean
in interface UniversalConnectionPoolAdapter
SQLException
- If any error occurs during the process of connection pool
creation.UniversalConnectionPoolManagerMBean
public Connection getConnection() throws SQLException
getConnection
in interface DataSource
SQLException
- if a database-access error occurs.public Connection getConnection(String username, String password) throws SQLException
getConnection
in interface DataSource
username
- 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 PoolDataSource
labels
- 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 PoolDataSource
username
- 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 CommonDataSource
SQLException
public void setLogWriter(PrintWriter logWriter) throws SQLException
setLogWriter
in interface CommonDataSource
SQLException
public void setLoginTimeout(int seconds) throws SQLException
setLoginTimeout
in interface CommonDataSource
seconds
- timeoutSQLException
- in case of negative valuepublic int getLoginTimeout()
getLoginTimeout
in interface CommonDataSource
public String getUser()
PoolDataSource
getUser
in interface PoolDataSource
public void setUser(String user) throws SQLException
PoolDataSource
setUser
in interface PoolDataSource
user
- Username to be set.SQLException
public String getPassword()
PoolDataSource
getPassword
in interface PoolDataSource
public void setPassword(String password) throws SQLException
PoolDataSource
setPassword
in interface PoolDataSource
password
- Password to be set.SQLException
public String getURL()
PoolDataSource
getURL
in interface PoolDataSource
public void setURL(String url) throws SQLException
PoolDataSource
setURL
in interface PoolDataSource
url
- URL to be set.SQLException
public void setServerName(String serverName) throws SQLException
setServerName
in interface PoolDataSource
serverName
- Database server name to be set.SQLException
public String getServerName()
getServerName
in interface PoolDataSource
public void setPortNumber(int portNumber) throws SQLException
setPortNumber
in interface PoolDataSource
portNumber
- Database port number to be set.SQLException
public int getPortNumber()
getPortNumber
in interface PoolDataSource
public void setDatabaseName(String databaseName) throws SQLException
setDatabaseName
in interface PoolDataSource
databaseName
- Database name to be set.SQLException
public String getDatabaseName()
getDatabaseName
in interface PoolDataSource
public void setDataSourceName(String dataSourceName) throws SQLException
setDataSourceName
in interface PoolDataSource
dataSourceName
- data source name to be set.SQLException
public String getDataSourceName()
getDataSourceName
in interface PoolDataSource
public void setDescription(String description) throws SQLException
setDescription
in interface PoolDataSource
description
- data source description to be set.SQLException
public String getDescription()
getDescription
in interface PoolDataSource
public void setNetworkProtocol(String networkProtocol) throws SQLException
setNetworkProtocol
in interface PoolDataSource
networkProtocol
- datasource networkProtocol to be set.SQLException
public String getNetworkProtocol()
getNetworkProtocol
in interface PoolDataSource
public void setRoleName(String roleName) throws SQLException
setRoleName
in interface PoolDataSource
roleName
- datasource role name to be set.SQLException
public String getRoleName()
getRoleName
in interface PoolDataSource
public void setInitialPoolSize(int initialPoolSize) throws SQLException
PoolDataSource
Integer.MAX_VALUE
. It is
illegal to set this to a value greater than the maximum pool size.
Defaults to 0.setInitialPoolSize
in interface PoolDataSource
initialPoolSize
- the initial pool size.SQLException
public int getInitialPoolSize()
PoolDataSource
getInitialPoolSize
in interface PoolDataSource
public void setMinPoolSize(int minPoolSize) throws SQLException
PoolDataSource
Integer.MAX_VALUE
. It is
illegal to set this to a value greater than the maximum pool size.
Defaults to 0.setMinPoolSize
in interface PoolDataSource
minPoolSize
- The minimum number of connections.SQLException
public int getMinPoolSize()
PoolDataSource
getMinPoolSize
in interface PoolDataSource
public void setMaxPoolSize(int maxPoolSize) throws SQLException
PoolDataSource
Integer.MAX_VALUE
.
Defaults to Integer.MAX_VALUE
.setMaxPoolSize
in interface PoolDataSource
maxPoolSize
- The maximum number of connections.SQLException
public int getMaxPoolSize()
PoolDataSource
getMaxPoolSize
in interface PoolDataSource
public int getMaxConnectionsPerService()
PoolDataSource
getMaxConnectionsPerService
in interface PoolDataSource
public void setInactiveConnectionTimeout(int inactivityTimeout) throws SQLException
PoolDataSource
Integer.MAX_VALUE
.
Defaults to 0.
Setting the value to 0 disables inactive connection timeout processing.setInactiveConnectionTimeout
in interface PoolDataSource
inactivityTimeout
- The inactive connection timeout in seconds.SQLException
public int getInactiveConnectionTimeout()
PoolDataSource
getInactiveConnectionTimeout
in interface PoolDataSource
public void setConnectionWaitTimeout(int waitTimeout) throws SQLException
PoolDataSource
Integer.MAX_VALUE
.
Defaults to 3.
Setting the value to 0 disables connection wait timeout processing.setConnectionWaitTimeout
in interface PoolDataSource
waitTimeout
- The amount of time to wait.SQLException
public int getConnectionWaitTimeout()
PoolDataSource
getConnectionWaitTimeout
in interface PoolDataSource
public void setTimeToLiveConnectionTimeout(int timeToLiveConnectionTimeout) throws SQLException
PoolDataSource
Integer.MAX_VALUE
.
Defaults to 0.
Setting the value to 0 disables time-to-live connection timeout processing.setTimeToLiveConnectionTimeout
in interface PoolDataSource
timeToLiveConnectionTimeout
- The maximum time (in seconds) a
used connection may be active.SQLException
public int getTimeToLiveConnectionTimeout()
PoolDataSource
getTimeToLiveConnectionTimeout
in interface PoolDataSource
public int getAbandonedConnectionTimeout()
PoolDataSource
getAbandonedConnectionTimeout
in interface PoolDataSource
public void setAbandonedConnectionTimeout(int abandonedConnectionTimeout) throws SQLException
PoolDataSource
Integer.MAX_VALUE
.
Defaults to 0.
Setting the value to 0 disables abandoned connection timeout.setAbandonedConnectionTimeout
in interface PoolDataSource
abandonedConnectionTimeout
- The value of how long a connection
has not been used before it is
abandoned (in seconds).SQLException
public void setTimeoutCheckInterval(int timeInterval) throws SQLException
PoolDataSource
Integer.MAX_VALUE
.
Defaults to 30.
Setting the value to 0 disables all connection timeout processing.setTimeoutCheckInterval
in interface PoolDataSource
timeInterval
- The timeInterval (in seconds) between checks
to enforce the timeout properties.SQLException
public int getTimeoutCheckInterval()
PoolDataSource
getTimeoutCheckInterval
in interface PoolDataSource
timeInterval
(in seconds) between
checks to enforce the timeout properties.public void setFastConnectionFailoverEnabled(boolean failoverEnabled) throws SQLException
PoolDataSource
setFastConnectionFailoverEnabled
in interface PoolDataSource
failoverEnabled
- true
if Fast Connection Failover is
enabled; false
if not.SQLException
public boolean getFastConnectionFailoverEnabled()
PoolDataSource
getFastConnectionFailoverEnabled
in interface PoolDataSource
true
if Fast Connection Failover is enabled;
false
if not.public String getConnectionFactoryClassName()
PoolDataSource
getConnectionFactoryClassName
in interface PoolDataSource
public void setConnectionFactoryClassName(String factoryClassName) throws SQLException
PoolDataSource
PoolDataSource
to operate.setConnectionFactoryClassName
in interface PoolDataSource
factoryClassName
- Connection factory class name for obtaining
physical connections.SQLException
public void setMaxStatements(int maxStatements) throws SQLException
setMaxStatements
in interface PoolDataSource
maxStatements
- 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 PoolDataSource
public void setMaxIdleTime(int idleTime) throws SQLException
setMaxIdleTime
in interface PoolDataSource
idleTime
- Idle timeout value in seconds.SQLException
public int getMaxIdleTime()
getMaxIdleTime
in interface PoolDataSource
public void setPropertyCycle(int propertyCycle) throws SQLException
setPropertyCycle
in interface PoolDataSource
propertyCycle
- Time interval in seconds to enforce
connection pool timeout properties.SQLException
public int getPropertyCycle()
getPropertyCycle
in interface PoolDataSource
public void setConnectionPoolName(String connectionPoolName) throws SQLException
setConnectionPoolName
in interface PoolDataSource
connectionPoolName
- Name of connection pool.SQLException
public String getConnectionPoolName()
getConnectionPoolName
in interface PoolDataSource
public void setValidateConnectionOnBorrow(boolean validateConnectionOnBorrow) throws SQLException
setValidateConnectionOnBorrow
in interface PoolDataSource
validateConnectionOnBorrow
- Whether or not a connection
being borrowed should first be
validated.SQLException
public boolean getValidateConnectionOnBorrow()
getValidateConnectionOnBorrow
in interface PoolDataSource
public void setSQLForValidateConnection(String SQLString) throws SQLException
setSQLForValidateConnection
in interface PoolDataSource
SQLString
- The SQL string used for connection validation.SQLException
public String getSQLForValidateConnection()
getSQLForValidateConnection
in interface PoolDataSource
public int getConnectionHarvestTriggerCount()
getConnectionHarvestTriggerCount
in interface PoolDataSource
public void setConnectionHarvestTriggerCount(int connectionHarvestTriggerCount) throws SQLException
setConnectionHarvestTriggerCount
in interface PoolDataSource
connectionHarvestTriggerCount
- The number of available
connections at which the
connection pool's connection
harvesting will occur.SQLException
public int getConnectionHarvestMaxCount()
getConnectionHarvestMaxCount
in interface PoolDataSource
public void setConnectionHarvestMaxCount(int connectionHarvestMaxCount) throws SQLException
setConnectionHarvestMaxCount
in interface PoolDataSource
connectionHarvestMaxCount
- the maximum number of connections
that may be harvested when the
connection harvesting occurs.SQLException
public long getMaxConnectionReuseTime()
getMaxConnectionReuseTime
in interface PoolDataSource
public void setMaxConnectionReuseTime(long maxConnectionReuseTime) throws SQLException
setMaxConnectionReuseTime
in interface PoolDataSource
connection
- reuse time (in seconds),
0 value means that the feature is disabled.SQLException
public int getMaxConnectionReuseCount()
getMaxConnectionReuseCount
in interface PoolDataSource
public void setMaxConnectionReuseCount(int maxConnectionReuseCount) throws SQLException
setMaxConnectionReuseCount
in interface PoolDataSource
connection
- reuse count,
0 value means that the feature is disabled.SQLException
public int getAvailableConnectionsCount()
getAvailableConnectionsCount
in interface PoolDataSource
public int getBorrowedConnectionsCount()
getBorrowedConnectionsCount
in interface PoolDataSource
public String getONSConfiguration() throws SQLException
getONSConfiguration
in interface PoolDataSource
SQLException
public 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 PoolDataSource
onsConfigStr
- The configuration string for remote ONS
subscription.SQLException
public void registerConnectionLabelingCallback(ConnectionLabelingCallback cbk) throws SQLException
registerConnectionLabelingCallback
in interface PoolDataSource
cbk
- 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 PoolDataSource
SQLException
- If callback removal fails.public void registerConnectionAffinityCallback(ConnectionAffinityCallback cbk) throws SQLException
registerConnectionAffinityCallback
in interface PoolDataSource
cbk
- Affinity Callback object that must be registered.SQLException
- If callback registration fails.public void removeConnectionAffinityCallback() throws SQLException
removeConnectionAffinityCallback
in interface PoolDataSource
SQLException
- If callback removal fails.public JDBCConnectionPoolStatistics getStatistics()
getStatistics
in interface PoolDataSource
public String getServiceName()
getServiceName
in interface PoolDataSource
public Properties getConnectionProperties()
getConnectionProperties
in interface PoolDataSource
public String getConnectionProperty(String propertyName)
getConnectionProperty
in interface PoolDataSource
propertyName
- 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 PoolDataSource
name
- 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.setConnectionFactoryProperties
public void setConnectionProperties(Properties connectionProperties) throws SQLException
oracle.jdbc.pool.OracleDataSource
in the Oracle
JDBC driver.setConnectionProperties
in interface PoolDataSource
connectionProperties
- Connection properties to be set on the connection factory class.SQLException
- If any exception occurred while setting the connection
properties.setConnectionFactoryProperties
public Properties getConnectionFactoryProperties()
getConnectionFactoryProperties
in interface PoolDataSource
public String getConnectionFactoryProperty(String propertyName)
getConnectionFactoryProperty
in interface PoolDataSource
propertyName
- 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 PoolDataSource
name
- 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 PoolDataSource
factoryProperties
- 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 static boolean isSetOnceProperty(String key)
key
- to checkpublic Reference getReference() throws NamingException
getReference
in interface Referenceable
NamingException
public Object getObjectInstance(Object refObj, Name name, Context nameCtx, Hashtable env) throws Exception
getObjectInstance
in interface ObjectFactory
Exception
public boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor
in interface Wrapper
iface
- Requested interface.SQLException
- If the argument is not an interface.public <T> T unwrap(Class<T> iface) throws SQLException
unwrap
in interface Wrapper
iface
- 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 PoolDataSource
cbk
- 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 PoolDataSource
SQLException
- If callback removal fails.public ConnectionInitializationCallback getConnectionInitializationCallback()
getConnectionInitializationCallback
in interface PoolDataSource
ConnectionInitializationCallback
,
or null if there is no callback registered.public int getConnectionLabelingHighCost()
PoolDataSource
getConnectionLabelingHighCost
in interface PoolDataSource
setConnectionLabelingHighCost
public void setConnectionLabelingHighCost(int highCost) throws SQLException
PoolDataSource
cost(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 PoolDataSource
highCost
- 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()
PoolDataSource
getConnectionRepurposeThreshold
in interface PoolDataSource
public void setConnectionRepurposeThreshold(int threshold) throws SQLException
PoolDataSource
setConnectionRepurposeThreshold
in interface PoolDataSource
threshold
- connection repurpose threshold to set.SQLException
- If any exception occurs while setting the threshold.getConnectionRepurposeThreshold
public int getHighCostConnectionReuseThreshold()
PoolDataSource
getHighCostConnectionReuseThreshold
in interface PoolDataSource
setConnectionLabelingHighCost
,
setHighCostConnectionReuseThreshold
public void setHighCostConnectionReuseThreshold(int threshold) throws SQLException
PoolDataSource
setHighCostConnectionReuseThreshold
in interface PoolDataSource
threshold
- The high-cost connection reuse threshold to set.SQLException
- If any exception occurs while setting the threshold.public Properties getPdbRoles()
getPdbRoles
in interface PoolDataSource
setPdbRoles
public int getSecondsToTrustIdleConnection()
setSecondsToTrustIdleConnection()
.getSecondsToTrustIdleConnection
in interface PoolDataSource
public 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 PoolDataSource
secondsToTrustIdleConnection
- The value of how long a connection can be trusted to skip
connectionValidationOnBorrowSQLException
public UCPConnectionBuilder createConnectionBuilder()
PoolDataSource
createConnectionBuilder
in interface PoolDataSource
PoolDataSource.createConnectionBuilder()
public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger
in interface CommonDataSource
SQLFeatureNotSupportedException
CommonDataSource.getParentLogger()
public int getQueryTimeout()
getQueryTimeout
in interface PoolDataSource
public void setQueryTimeout(int queryTimeout) throws SQLException
setQueryTimeout
in interface PoolDataSource
queryTimeout
- in secondsSQLException
public int getMaxConnectionsPerShard()
getMaxConnectionsPerShard
in interface PoolDataSource
public void setMaxConnectionsPerShard(int maxConnectionsPerShard) throws SQLException
setMaxConnectionsPerShard
in interface PoolDataSource
maxConnectionsPerShard
- 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, 2017, Oracle. All rights reserved.