public interface PoolDataSource extends javax.sql.DataSource, Diagnosable, oracle.ucp.config.PropertyNames
PoolDataSource
uses Universal Connection Pool internally. See setters for pool properties
and their default values.
The interface also defines the JNDI property names supported by UCP datasource. These properties can be configured in application servers that support datasource configuration using JNDI feature.
For example, In Tomcat you can define the UCP pool JNDI resource in application's context.xml like below-
<Resource name="tomcat/UCPPool" auth="Container"
factory="oracle.ucp.jdbc.PoolDataSourceImpl"
type="oracle.ucp.jdbc.PoolDataSource"
description="UCP Pool in Tomcat"
connectionFactoryClassName="oracle.jdbc.pool.OracleDataSource"
user="<user>"
password="<password>"
initialPoolSize="<val>"
url="<database_url>"
/>
UniversalConnectionPool| Modifier and Type | Interface and Description |
|---|---|
static interface |
PoolDataSource.HostnameResolver |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
SYSTEM_PROPERTY_AFFINITY_STRICT
Strict RAC affinity flag.
|
static java.lang.String |
SYSTEM_PROPERTY_BEGIN_REQUEST_AT_CONNECTION_CREATION
Driver's implicit beginRequest switch.
|
static java.lang.String |
SYSTEM_PROPERTY_CONNECTION_CREATION_RETRY_DELAY
The retry delay for connection creation polling.
|
static java.lang.String |
SYSTEM_PROPERTY_CREATE_CONNECTION_IN_BORROW_THREAD
Since 23.4, for backward compatibility: there are two modes to grow a pool.
|
static java.lang.String |
SYSTEM_PROPERTY_DESTROY_ON_RELOAD
What to do if a new pool with existing pool name gets created.
|
static java.lang.String |
SYSTEM_PROPERTY_DIAGNOSTIC_BUFFER_SIZE
Diagnosability: initial in-memory trace size.
|
static java.lang.String |
SYSTEM_PROPERTY_DIAGNOSTIC_ENABLE_LOGGING
Diagnosability: is debug logging enabled?
|
static java.lang.String |
SYSTEM_PROPERTY_DIAGNOSTIC_ENABLE_TRACE
Diagnosability: is tracing enabled?
|
static java.lang.String |
SYSTEM_PROPERTY_DIAGNOSTIC_ERROR_CODES_TO_WATCH_LIST
Diagnosability: error codes to watch and trigger dumping in-memory tracing buffer into a logger.
|
static java.lang.String |
SYSTEM_PROPERTY_DIAGNOSTIC_LOGGING_LEVEL
Diagnosability: initial logging level.
|
static java.lang.String |
SYSTEM_PROPERTY_ENABLE_SHUTDOWN_HOOK
The shutdown hook of UCP will attempt to gracefully close connections during
shutdown by first closing available connections in the pool and then
continuously retrying until, eventually, all connections are closed.
|
static java.lang.String |
SYSTEM_PROPERTY_FAN_ENABLED
Driver's High Availability processing switch.
|
static java.lang.String |
SYSTEM_PROPERTY_IMITATE_ASYNC_BORROW
Asynchronous borrow imitation switch.
|
static java.lang.String |
SYSTEM_PROPERTY_MAX_INIT_THREADS
The maximum number of worker threads to reach initial pool size.
|
static java.lang.String |
SYSTEM_PROPERTY_PRE_WLS1212_COMPATIBLE
Pre-WLS 12.1.2 compatibility flag.
|
static java.lang.String |
SYSTEM_PROPERTY_RLB_INOPERABILITY_TIMEOUT
Timeout in seconds for the UCP Runtime Load Balancer to be allowed not to follow RLB advisories in case
of inoperability of at least one RAC instance (i.e.
|
static java.lang.String |
SYSTEM_PROPERTY_SELFTUNING
Pool Size self-tuning switch.
|
static java.lang.String |
SYSTEM_PROPERTY_TIMERS_AFFECT_ALL_CONNECTIONS
The switch to change the logic of InactiveConnectionTimeout and MaxConnectionReuseTime handling.
|
static java.lang.String |
SYSTEM_PROPERTY_WLS_JTA
UCP native data source in WebLogic to work with WLS transaction manager for JTA/XA transactions.
|
static java.lang.String |
SYSTEM_PROPERTY_XML_CONFIG_FILE
The XML configuration file path for UCP.
|
UCP_ABANDONED_CONNECTION_TIMEOUT, UCP_COMMIT_ON_CONNECTION_RETURN, UCP_CONNECTION_AFFINITY_CALLBACK, UCP_CONNECTION_CREATION_CONSUMER, 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_VALIDATION_TIMEOUT, UCP_CONNECTION_WAIT_DURATION, UCP_CONNECTION_WAIT_DURATION_IN_MILLIS, UCP_CONNECTION_WAIT_TIMEOUT, UCP_CONNECTION_WAIT_TIMEOUT_WHILE_SERVICE_DOWN, UCP_CREATE_CONNECTION_IN_BORROW_THREAD, UCP_DATA_SOURCE_FROM_CONFIGURATION, UCP_DATA_SOURCE_NAME, UCP_DATABASE_NAME, UCP_DESCRIPTION, UCP_EVENT_LISTENER_PROVIDER, UCP_FAIL_FAST_ON_CHUNK_UNAVAILABLE, UCP_FAST_CONNECTION_FAILOVER_ENABLED, UCP_HIGH_COST_CONNECTION_REUSE_THRESHOLD, UCP_INACTIVE_CONNECTION_TIMEOUT, UCP_INIT_PER_SHARD, 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, UCP_MAX_IDLE_TIME, UCP_MAX_POOL_SIZE, UCP_MAX_STATEMENTS, UCP_MIN_CONNECTIONS_PER_SHARD, UCP_MIN_IDLE, UCP_MIN_IDLE_PER_SHARD, 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_QUERY_TIMEOUT, UCP_READONLY_INSTANCE_ALLOWED, UCP_ROLE_NAME, UCP_SECONDS_TO_TRUST_IDLE_CONNECTION, UCP_SERVER_NAME, UCP_SERVICE_NAME, UCP_SHARDING_MODE, UCP_SHAREABLE, UCP_SQL_FOR_VALIDATE_CONNECTION, UCP_TIME_TO_LIVE_CONNECTION_TIMEOUT, UCP_TIMEOUT_CHECK_INTERVAL, UCP_URL, UCP_USER, UCP_VALIDATE_CONNECTION_ON_BORROW, UCP_WALLET_FILE, UCP_WALLET_PASSWORD| Modifier and Type | Method and Description |
|---|---|
UCPConnectionBuilder |
createConnectionBuilder()
Creates a new UCPConnectionBuilder instance.
|
default oracle.jdbc.OracleShardingKeyBuilder |
createShardingKeyBuilder()
Creates a new OracleShardingKeyBuilder instance
|
default 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(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,
java.util.Properties labels)
Attempts to obtain a database connection with the requested
connection labels.
|
default java.util.function.Consumer<oracle.ucp.ConnectionCreationInformation> |
getConnectionCreationConsumer()
Obtains the registered connection creation Consumer, if any.
|
default 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.
|
default int |
getConnectionHarvestMaxCount()
Gets the maximum number of connections that may be harvested when the
connection harvesting occurs.
|
default int |
getConnectionHarvestTriggerCount()
Gets the number of available connections below which the connection
pool's connection harvesting will occur.
|
default ConnectionInitializationCallback |
getConnectionInitializationCallback()
Obtains the registered connection initialization callback, if any.
|
default int |
getConnectionLabelingHighCost()
Obtains the cost value which identifies a connection as "high-cost"
for connection labeling.
|
default 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.
|
default int |
getConnectionRepurposeThreshold()
Gets the connection repurpose threshold for the pool.
|
default int |
getConnectionValidationTimeout()
Connection validation timeout getter
|
java.time.Duration |
getConnectionWaitDuration()
Gets the maximum time (in seconds) that any connection borrow request
can wait before it returns to the application.
|
int |
getConnectionWaitTimeout()
Deprecated.
|
long |
getConnectionWaitTimeoutWhileServiceDown()
Get connection wait timeout that applies while service is down in seconds.
|
default java.lang.String |
getDatabaseName()
Gets the database name.
|
default java.lang.String |
getDataSourceName()
Gets the data source name.
|
default java.lang.String |
getDescription()
Gets the data source description.
|
default boolean |
getFastConnectionFailoverEnabled()
Checks if Fast Connection Failover is enabled.
|
default int |
getHighCostConnectionReuseThreshold()
Obtains the high-cost connection reuse threshold property
value for connection labeling.
|
default int |
getInactiveConnectionTimeout()
Gets the inactive connection timeout.
|
default int |
getInitialPoolSize()
Gets the initial pool size.
|
default int |
getMaxConnectionReuseCount()
Gets the maximum connection reuse count property value.
|
default long |
getMaxConnectionReuseTime()
Gets the maximum connection reuse time property value.
|
default int |
getMaxConnectionsPerService()
Gets the maximum number of connections that can be obtained to a particular
service, in a shared pool.
|
default int |
getMaxConnectionsPerShard()
Gets the currently configured max connections that can be created per shard
from this connection pool.
|
default int |
getMaxIdle()
Gets the maximum number of idle connections that the connection pool will
maintain.
|
default int |
getMaxIdleTime()
Gets the maximum idle time.
|
default int |
getMaxPoolSize()
Gets the maximum number of connections that the connection pool will
maintain.
|
default int |
getMaxStatements()
Gets the maximum number of statements that may be pooled or cached on a
Connection.
|
default int |
getMinIdle()
Gets the minimum number of idle connections that the connection pool will
maintain.
|
default int |
getMinPoolSize()
Gets the minimum number of connections that the connection pool will
maintain.
|
default java.lang.String |
getNetworkProtocol()
Gets the data source network protocol.
|
default java.lang.String |
getONSConfiguration()
Returns the ONS configuration string that is used for remote ONS
subscription in the form specified in
setONSConfiguration(String). |
default java.lang.String |
getPassword()
Deprecated.
|
java.util.Properties |
getPdbRoles()
Gets the PDB roles specified for this datasource
|
oracle.ucp.config.PoolProperties |
getPoolProperties()
Pool properties storage getter.
|
java.lang.String |
getPoolProperty(java.lang.String key)
Pool property getter.
|
default int |
getPortNumber()
Gets the database port number.
|
default int |
getPropertyCycle()
Gets the property cycle in seconds.
|
default int |
getQueryTimeout()
Gets the number of seconds the driver will wait for a Statement object to execute to the given number of seconds.
|
default java.lang.String |
getRoleName()
Gets the data source role name.
|
default int |
getSecondsToTrustIdleConnection()
Gets the seconds To Trust Idle Connection value.
|
default java.lang.String |
getServerName()
Gets the database server name.
|
java.lang.String |
getServiceName()
Gets the service name set on this data source
|
default boolean |
getShardingMode()
Returns the mode of UCP when UCP is using a Sharded Database.
|
default java.lang.String |
getSQLForValidateConnection()
Gets the value of the
SQLForValidateConnection property. |
JDBCConnectionPoolStatistics |
getStatistics()
Gets the statistics of the connection pool.
|
default int |
getTimeoutCheckInterval()
Gets the timeout check interval (in seconds).
|
default int |
getTimeToLiveConnectionTimeout()
Gets the maximum time (in seconds) a connection may remain in-use.
|
default java.lang.String |
getUCPEventListenerProvider()
Returns the UCP event listener provider name.
|
default java.lang.String |
getURL()
Gets the URL for this data source.
|
default java.lang.String |
getUser()
Gets the user name for this data source.
|
default boolean |
getValidateConnectionOnBorrow()
Returns whether or not a connection being borrowed should first be
validated.
|
default boolean |
isCommitOnConnectionReturn()
Returns the boolean value for the property that controls the behavior of UCP
when a connection is released back to
the pool with pending uncommitted changes in an active transaction.
|
default boolean |
isCreateConnectionInBorrowThread()
Returns the connection creation mode: either "true" if connections are created
using the borrowing thread, or "false" if connections are created in the
background (the default).
|
default boolean |
isReadOnlyInstanceAllowed()
Returns true if the connection borrow is allowed to a read-only instance,
false otherwise.
|
void |
reconfigureDataSource(java.util.Properties configuration)
Reconfigures the data source.
|
void |
registerConnectionAffinityCallback(ConnectionAffinityCallback cbk)
Registers a connection affinity callback on the connection pool.
|
default void |
registerConnectionCreationConsumer(java.util.function.Consumer<oracle.ucp.ConnectionCreationInformation> consumer)
Registers a connection creation Consumer.
|
void |
registerConnectionInitializationCallback(ConnectionInitializationCallback cbk)
Registers a connection initialization callback.
|
void |
registerConnectionLabelingCallback(ConnectionLabelingCallback cbk)
Registers a connection labeling callback with the underlying
connection pool.
|
void |
removeConnectionAffinityCallback()
Removes the
ConnectionAffinityCallback object registered on
the connection pool. |
void |
removeConnectionLabelingCallback()
Removes the
ConnectionLabelingCallback object registered with the
underlying connection pool, if any. |
default void |
setAbandonedConnectionTimeout(int abandonedConnectionTimeout)
Sets the abandoned connection timeout.
|
default void |
setCommitOnConnectionReturn(boolean commit)
Sets the boolean value for the property that controls the behavior of UCP
when a connection is released back to
the pool with pending uncommitted changes in an active transaction.
|
default 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.
|
default void |
setConnectionHarvestMaxCount(int connectionHarvestMaxCount)
Sets the maximum number of connections that may be harvested when the
connection harvesting occurs.
|
default void |
setConnectionHarvestTriggerCount(int connectionHarvestTriggerCount)
Sets the number of available connections below which the connection
pool's connection harvesting will occur.
|
default void |
setConnectionLabelingHighCost(int highCost)
Sets the cost value which identifies a connection as "high-cost"
for connection labeling.
|
default 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.
|
default void |
setConnectionRepurposeThreshold(int threshold)
Sets the connection repurpose threshold for the pool.
|
default void |
setConnectionValidationTimeout(int connectionValidationTimeout)
This property changes the connection validation timeout
which is specified in seconds.
|
void |
setConnectionWaitDuration(java.time.Duration waitDuration)
Configures how much time a connection request call may wait before it either
successfully returns a connection or throws an exception.
|
void |
setConnectionWaitTimeout(int waitTimeout)
Deprecated.
|
void |
setConnectionWaitTimeoutWhileServiceDown(long timeoutServiceDown)
Sets this connection wait timeout that applies only when the Database service isn't
available, for example during the Database server startup or during a service
switchover to a secondary site.
|
default void |
setCreateConnectionInBorrowThread(boolean createConnectionInBorrowThread)
Set this flag to true to make UCP use the borrowing thread to create new
connections.
|
default void |
setDatabaseName(java.lang.String databaseName)
Sets the database name.
|
default void |
setDataSourceName(java.lang.String dataSourceName)
Sets the data source name.
|
default void |
setDescription(java.lang.String description)
Sets the data source description.
|
default void |
setFastConnectionFailoverEnabled(boolean failoverEnabled)
Enables Fast Connection Failover (FCF) for the connection pool accessed
using this pool-enabled data source.
|
default void |
setHighCostConnectionReuseThreshold(int threshold)
Sets the high-cost connection reuse threshold for connection labeling.
|
void |
setHostnameResolver(PoolDataSource.HostnameResolver hostnameResolver)
Specifies a
PoolDataSource.HostnameResolver to use by the pool |
default void |
setInactiveConnectionTimeout(int inactivityTimeout)
Sets the inactive connection timeout.
|
default void |
setInitialPoolSize(int initialPoolSize)
Sets the initial pool size.
|
default void |
setMaxConnectionReuseCount(int maxConnectionReuseCount)
Sets the maximum connection reuse count property.
|
default void |
setMaxConnectionReuseTime(long maxConnectionReuseTime)
Sets the maximum connection reuse time property.
|
default void |
setMaxConnectionsPerShard(int maxConnectionsPerShard)
Sets the max number of connections that can be created per shard from this
connection pool.
|
default void |
setMaxIdle(int maxIdle)
Sets the maximum number of idle connections.
|
default void |
setMaxIdleTime(int idleTime)
Sets the maximum idle time for available connections in the pool.
|
default void |
setMaxPoolSize(int maxPoolSize)
Sets the maximum number of connections.
|
default void |
setMaxStatements(int maxStatements)
Sets the maximum number of statements that may be pooled or cached on
a connection.
|
default void |
setMinIdle(int minIdle)
Sets the minimum number of idle connections.
|
default void |
setMinPoolSize(int minPoolSize)
Sets the minimum number of connections.
|
default void |
setNetworkProtocol(java.lang.String networkProtocol)
Sets the data source network protocol.
|
default void |
setONSConfiguration(java.lang.String onsConfigStr)
Sets the configuration string used for remote ONS subscription.
|
default void |
setPassword(java.lang.String pd)
Sets the password with which connections have to be obtained.
|
void |
setPoolProperties(java.util.Properties props)
Configure UCP Pool properties with a
java.util.Properties collection??? |
void |
setPoolProperty(oracle.ucp.config.PoolProperty poolProperty,
java.lang.Object value,
int errorCode)
Pool property setter helper.
|
void |
setPoolProperty(java.lang.String key,
java.lang.String value)
Configure a single UCP Pool property.
|
default void |
setPortNumber(int portNumber)
Sets the database port number.
|
void |
setProperties(java.lang.String propsAsString)
Configure UCP Pool properties through a comma separated list of properties.
|
default void |
setPropertyCycle(int propertyCycle)
Sets the property cycle in seconds.
|
default 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.
|
default void |
setReadOnlyInstanceAllowed(boolean readOnlyInstanceAllowed)
Sets the read-only instance allowed value on the datasource.
|
default void |
setRoleName(java.lang.String roleName)
Sets the data source role name.
|
default void |
setSecondsToTrustIdleConnection(int secondsToTrustIdleConnection)
Sets the time in seconds to trust an idle connection to skip a validation
test.
|
default void |
setServerName(java.lang.String serverName)
Sets the database server name.
|
default void |
setShardingMode(boolean shardingMode)
This API changes the mode of UCP when UCP is using a Sharded Database.
|
default void |
setSQLForValidateConnection(java.lang.String SQLString)
Sets the value of the
SQLForValidateConnection property. |
void |
setSSLContext(javax.net.ssl.SSLContext sslContext)
Specifies a
SSLContext to use as a factory for
SSLEngine objects that carry out the TLS
protocol. |
default void |
setTimeoutCheckInterval(int timeInterval)
Sets the timeoutCheckInterval (in seconds).
|
default void |
setTimeToLiveConnectionTimeout(int timeToLiveConnectionTimeout)
Sets the maximum time (in seconds) a connection may remain in-use.
|
void |
setTokenSupplier(java.util.function.Supplier<? extends oracle.jdbc.AccessToken> tokenSupplier)
Sets a supplier function that generates an access token when creating a
connection with this
DataSource. |
default void |
setUCPEventListenerProvider(java.lang.String UCPEventListenerProvider)
Sets the UCP event listener provider class name.
|
default void |
setURL(java.lang.String url)
Sets the URL that the data source uses to obtain connections to the
database.
|
default void |
setUser(java.lang.String userName)
Sets the user name with which connections have to be obtained.
|
default void |
setValidateConnectionOnBorrow(boolean validateConnectionOnBorrow)
Makes the pool validate the connection before returning it to the user by
calling the JDBC API "isValid".
|
default void |
unregisterConnectionCreationConsumer()
Unregisters the connection creation Consumer on this pool.
|
void |
unregisterConnectionInitializationCallback()
Unregisters the connection initialization callback on this pool.
|
getLoginTimeout, getLogWriter, getParentLogger, setLoginTimeout, setLogWriterbeginCurrentSql, debug, debug, endCurrentSql, format, getDiagnosable, isLoggingLevelFinest, resumeLogging, secure, suspendLogging, trace, tracestatic final java.lang.String SYSTEM_PROPERTY_AFFINITY_STRICT
This system property indicates whether RAC affinity is strict or not. The default value is "false".
static final java.lang.String SYSTEM_PROPERTY_MAX_INIT_THREADS
This system property defines how many worker threads will perticipate in connection pool warming up creating designated number of initial connections. The default value is 4.
static final java.lang.String SYSTEM_PROPERTY_PRE_WLS1212_COMPATIBLE
This system property defines whether we should operate in pre-WLS 12.1.2 compatible mode or not. If the property value is "true", we'll be backward-compatible with WLS 10.3.6 and 12.1.1. This is a transient property that will be removed in a future version/patch. The default value is "false".
static final java.lang.String SYSTEM_PROPERTY_CONNECTION_CREATION_RETRY_DELAY
When a database is inoperable, UCP makes periodic connection creation reattempts. This system property defined the re-attempt timeout in milliseconds. The default value is 3000 milliseconds.
static final java.lang.String SYSTEM_PROPERTY_FAN_ENABLED
This system property is the flag for disabling Oracle JDBC driver's High Availability processing. This applies to both UCP and WLS AGL use cases. The default value is "false".
static final java.lang.String SYSTEM_PROPERTY_BEGIN_REQUEST_AT_CONNECTION_CREATION
This system property is the flag for disabling Oracle JDBC driver's implicit beginRequest for Auto-AC (Automatic Application Continuity). This applies to both UCP and WLS AGL use cases. The default value is "false".
static final java.lang.String SYSTEM_PROPERTY_XML_CONFIG_FILE
This system property defines the pathname for an XML file to read and interpret for automatic UCP configuring. No default value (empty string).
static final java.lang.String SYSTEM_PROPERTY_DESTROY_ON_RELOAD
This system property is the flag instructing whether to destroy a pool or throw the "pool already exists" exception if there is an attempt to create a new pool with the name of existing pool. This feature has been implemented per JBoss request because thir reload procedure recreates a pool with the same name expecting the old one is implicitly gets destroyed. The traditional pool's behavior in this case is to throw the exception. The default value is "false".
static final java.lang.String SYSTEM_PROPERTY_IMITATE_ASYNC_BORROW
This system property is the flag defining whether to run real asynchronous borrow mechanism or its imitation through blocking borrow. This property is introduced for debugging and testing purposes. The default value is "false".
static final java.lang.String SYSTEM_PROPERTY_SELFTUNING
This system property is the flag to enable or disable pool size self-tuning. If self-tuning is enabled, UCP will try to keep pool's working set of connection to be able to effectively serve recent number of connection borrow requests. Self-tuning mechanism will not bring the working set of connections beyond designated pool bounds (minumum and maximum pool size). The default value is "false", i.e. self-tuning is disabled.
static final java.lang.String SYSTEM_PROPERTY_WLS_JTA
This system property is the flag that allows UCP native data source in WebLogic to work with WLS transaction manager for JTA/XA transactions. The feature is disabled by default, and can be enabled by setting the system property to true.
static final java.lang.String SYSTEM_PROPERTY_TIMERS_AFFECT_ALL_CONNECTIONS
This system property changes the behavior of InactiveConnectionTimeout and MaxConnectionReuseTime: if set to false, a pool will be reduced down to minPoolSize, other connections, even if applicable, will be left opened and not replaced. If set to false and the number of idle connections is equal to the min pool size, then these timeouts are ignored. If set to true, the timeouts are enforced and will affect connections even if the number of idle connections is smaller than the min pool size. This will cause idle connections to be purged and re-created. The default value is "false".
static final java.lang.String SYSTEM_PROPERTY_DIAGNOSTIC_ENABLE_TRACE
This system property is the flag for enabling diagnosability tracing. Initial state for a flag allowing publishing a trace into DiagnosticsCollector's memory handlers. Tracing in this context is a collecting logging messages into an in-memory ring buffer. The default value is "true".
static final java.lang.String SYSTEM_PROPERTY_DIAGNOSTIC_ENABLE_LOGGING
Initial state for a flag allowing publishing a trace into DiagnosticsCollector's debug logger. Logging is the same as the Java logging API. The default value is "false".
static final java.lang.String SYSTEM_PROPERTY_DIAGNOSTIC_BUFFER_SIZE
Initial size of a Diagnosability in-memory tracing buffers. The default value is 1024 log messages.
static final java.lang.String SYSTEM_PROPERTY_DIAGNOSTIC_LOGGING_LEVEL
This system property defines the default logging level for all loggers. Every logger, if not explicitly leveled in the logging config file, will be leveled with this level. The default value is Level.INFO.
static final java.lang.String SYSTEM_PROPERTY_DIAGNOSTIC_ERROR_CODES_TO_WATCH_LIST
This system property defined the comma separated list of SQLException and UniversalConnectionPoolException error codes to trigger in-memory buffer dump into an appropriate logger. The default value is empty list, nothing.
static final java.lang.String SYSTEM_PROPERTY_ENABLE_SHUTDOWN_HOOK
-Doracle.ucp.enableShutdownHook=false
static final java.lang.String SYSTEM_PROPERTY_RLB_INOPERABILITY_TIMEOUT
static final java.lang.String SYSTEM_PROPERTY_CREATE_CONNECTION_IN_BORROW_THREAD
Since 23.4, for backward compatibility: there are two modes to grow a pool. If set to true, pool grows with a borrow thread. If set to false, pool grows with a background executor. This property is "false" by default.
This setting can be overridden by the following property:
setCreateConnectionInBorrowThread(boolean).
for an apropriate PoolDataSource's object.
If this property is set to false, a pool waits no longer than a designated connection wait duration no matter
how long it takes to create a new connection to grow a pool, if no connection is available at this moment.
If this property is set to true, then in this backward compatibility mode a pool waits for a connection to be
synchronously created in a borrow thread, and the waiting time can take longer than connectionWaitDuration.
For connectionWaitDuration please refer to
setConnectionWaitDuration(java.time.Duration).
default int getInitialPoolSize()
default void setInitialPoolSize(int initialPoolSize)
throws java.sql.SQLException
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.
initialPoolSize - the initial pool size.java.sql.SQLException - in case of inability to set size.default int getMinPoolSize()
default void setMinPoolSize(int minPoolSize)
throws java.sql.SQLException
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.
The default is 1 connection.
minPoolSize - The minimum number of connections.java.sql.SQLException - in case of inability to set min pool size.default int getMinIdle()
default void setMinIdle(int minIdle)
throws java.sql.SQLException
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.
The default is 0.
minIdle - The minimum number of idle connections.java.sql.SQLException - in case of inability to set min idle.default int getMaxIdle()
default void setMaxIdle(int maxIdle)
throws java.sql.SQLException
The range of valid values is 0 to Integer.MAX_VALUE.
The default is Integer.MAX_VALUE.
maxIdle - The maximum number of idle connections.java.sql.SQLException - in case of inability to set max idle.default int getMaxPoolSize()
default void setMaxPoolSize(int maxPoolSize)
throws java.sql.SQLException
The range of valid values is 1 to Integer.MAX_VALUE.
Default value is Integer.MAX_VALUE.
maxPoolSize - The maximum number of connections.java.sql.SQLException - in case of inability to set max pool size.default int getInactiveConnectionTimeout()
default void setInactiveConnectionTimeout(int inactivityTimeout)
throws java.sql.SQLException
The range of valid values is 0 to Integer.MAX_VALUE.
Defaults to 0.
Setting the value to 0 disables inactive connection timeout processing.
This property's behaviour is affected by the system property oracle.ucp.timersAffectAllConnections.
For more details go to -
SYSTEM_PROPERTY_TIMERS_AFFECT_ALL_CONNECTIONS.
inactivityTimeout - The inactive connection timeout in seconds.java.sql.SQLException - in case of inability to set timeout.default int getAbandonedConnectionTimeout()
default void setAbandonedConnectionTimeout(int abandonedConnectionTimeout)
throws java.sql.SQLException
The range of valid values is 0 to Integer.MAX_VALUE.
Defaults to 0.
Setting the value to 0 disables abandoned connection timeout.
abandonedConnectionTimeout - The value of how long a connection
has not been used before it is
abandoned (in seconds).java.sql.SQLException - in case of inability to set timeout.@Deprecated int getConnectionWaitTimeout()
Gets the maximum time (in seconds) that any connection borrow request can wait before it returns to the application.
This method is deprecated.
Use getConnectionWaitDuration() instead.
setConnectionWaitTimeoutjava.time.Duration getConnectionWaitDuration()
Gets the maximum time (in seconds) that any connection borrow request can wait before it returns to the application.
setConnectionWaitDuration@Deprecated
void setConnectionWaitTimeout(int waitTimeout)
throws java.sql.SQLException
Configures how much time a connection request call may wait before it either successfully returns a connection or throws an exception.
The wait duration starts from the point when a connection borrow request is submitted to the pool.
During this time, UCP may either return a connection that's currently available in the pool (ideal scenario) or create a new connection if the pool hasn't reached its maximum size. Otherwise, UCP waits for a connection to be returned to the pool.
By default, the connection wait timeout is set to 3 seconds.
Setting the timeout to 0 makes UCP throw an exception immediately if there is no connection available and no room to grow the pool. Note that it still allows UCP to create a new connection if the maximum size hasn't been reached, and that may take some time.
This method is deprecated.
Use setConnectionWaitDuration(java.time.Duration) instead.
waitTimeout - The amount of time in seconds for a connection request to wait.java.sql.SQLException - in case it was not possible to set timeout.void setConnectionWaitDuration(java.time.Duration waitDuration)
throws java.sql.SQLException
Configures how much time a connection request call may wait before it either successfully returns a connection or throws an exception.
The wait duration starts from the point when a connection borrow request is submitted to the pool.
During this time, UCP may either return a connection that's currently available in the pool (ideal scenario) or create a new connection if the pool hasn't reached its maximum size. Otherwise, UCP waits for a connection to be returned to the pool.
By default, the connection wait timeout is set to 3 seconds.
Setting the connection wait timeout to
Duration.ZERO makes UCP throw an exception immediately if there is no
connection available and no room to grow the pool. Note that it still allows UCP
to create a new connection if the maximum size hasn't been reached, and that may
take some time.
waitDuration - The duration for a connection request to wait.java.sql.SQLException - in case it was not possible to set timeout.long getConnectionWaitTimeoutWhileServiceDown()
void setConnectionWaitTimeoutWhileServiceDown(long timeoutServiceDown)
throws java.sql.SQLException
Sets this connection wait timeout that applies only when the Database service isn't available, for example during the Database server startup or during a service switchover to a secondary site. The value must be a number of seconds, and, by default, this timeout is disabled.
The value set for this timeout must be larger than the regular connection wait timeout to have an effect. You can set the regular connection wait timeout to a fairly aggressive value, for example 3 seconds, and this timeout to a much higher value, for example 300 seconds (5 minutes). With such a configuration, your connection requests will have to return with 3 seconds during normal operations, but may wait up to 5 minutes when the database service isn't available. This will give the application a chance to wait long enough for the Database service to become available again.
timeoutServiceDown - the timeout that applies when service is down in seconds.java.sql.SQLException - in case it was not possible to set timeout.default int getTimeToLiveConnectionTimeout()
default void setTimeToLiveConnectionTimeout(int timeToLiveConnectionTimeout)
throws java.sql.SQLException
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.
timeToLiveConnectionTimeout - The maximum time (in seconds) a
used connection may be active.java.sql.SQLException - in case of inability to set timeout.default void setTimeoutCheckInterval(int timeInterval)
throws java.sql.SQLException
The range of valid values is 0 to Integer.MAX_VALUE.
Defaults to 30.
Setting the value to 0 disables all connection timeout processing.
timeInterval - The timeInterval (in seconds) between checks
to enforce the timeout properties.java.sql.SQLException - in case of inability to set interval.default int getTimeoutCheckInterval()
timeInterval (in seconds) between
checks to enforce the timeout properties.default void setFastConnectionFailoverEnabled(boolean failoverEnabled)
throws java.sql.SQLException
failoverEnabled - true if Fast Connection Failover is
enabled; false if not.java.sql.SQLException - in case of inability to set flag.default boolean getFastConnectionFailoverEnabled()
true if Fast Connection Failover is enabled;
false if not.default java.lang.String getConnectionFactoryClassName()
default void setConnectionFactoryClassName(java.lang.String factoryClassName)
throws java.sql.SQLException
PoolDataSource to operate.factoryClassName - Connection factory class name for obtaining
physical connections.java.sql.SQLException - in case of inability to set factory class name.default void setMaxStatements(int maxStatements)
throws java.sql.SQLException
The range of valid values is 0 to Integer.MAX_VALUE.
Defaults to 0.
maxStatements - 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.default int getMaxStatements()
default void setMaxIdleTime(int idleTime)
throws java.sql.SQLException
The range of valid values is 0 to Integer.MAX_VALUE.
Defaults to 0.
idleTime - Maximum idle time in seconds.java.sql.SQLException - in case of inability to set idle time.default int getMaxIdleTime()
default java.lang.String getUCPEventListenerProvider()
default void setUCPEventListenerProvider(java.lang.String UCPEventListenerProvider)
throws java.sql.SQLException
UCPEventListenerProvider - The fully qualified class name that implements UCPEventListenerProvider.
Must match the value returned by the provider's getName() method.java.sql.SQLException - if the provider name is invalid or doesn't implement the required interfacedefault void setPropertyCycle(int propertyCycle)
throws java.sql.SQLException
timeoutCheckInterval.
The range of valid values is 0 to Integer.MAX_VALUE.
Defaults to 30.
propertyCycle - Time interval in seconds to enforce
connection pool timeout properties.java.sql.SQLException - in case of inability to set property cycle.default int getPropertyCycle()
default void setConnectionPoolName(java.lang.String connectionPoolName)
throws java.sql.SQLException
If not set, the pool name will be automatically generated.
connectionPoolName - Name of the connection pool.java.sql.SQLException - in case of inability to set name.default java.lang.String getConnectionPoolName()
default void setURL(java.lang.String url)
throws java.sql.SQLException
url - URL to be set.java.sql.SQLException - in case of inability to set URL.default java.lang.String getURL()
default void setUser(java.lang.String userName)
throws java.sql.SQLException
userName - Username to be set.java.sql.SQLException - in case of inability to set user.default java.lang.String getUser()
default void setPassword(java.lang.String pd)
throws java.sql.SQLException
pd - Password to be set.java.sql.SQLException - in case of inability to set password.@Deprecated default java.lang.String getPassword()
default void setServerName(java.lang.String serverName)
throws java.sql.SQLException
serverName - Database server name to be set.java.sql.SQLException - in case of inability to set server name.default java.lang.String getServerName()
default void setPortNumber(int portNumber)
throws java.sql.SQLException
portNumber - Database port number to be set.java.sql.SQLException - in case of inability to set port number.default int getPortNumber()
default void setDatabaseName(java.lang.String databaseName)
throws java.sql.SQLException
databaseName - Database name to be set.java.sql.SQLException - in case of inability to set db name.default java.lang.String getDatabaseName()
default void setDataSourceName(java.lang.String dataSourceName)
throws java.sql.SQLException
dataSourceName - data source name to be set.java.sql.SQLException - in case of inability to set datasource name.default java.lang.String getDataSourceName()
default void setDescription(java.lang.String description)
throws java.sql.SQLException
description - data source description to be set.java.sql.SQLException - in case of inability to set description.default java.lang.String getDescription()
default void setNetworkProtocol(java.lang.String networkProtocol)
throws java.sql.SQLException
networkProtocol - data source network protocol to be set.java.sql.SQLException - in case of inability to set protocol.default java.lang.String getNetworkProtocol()
default void setRoleName(java.lang.String roleName)
throws java.sql.SQLException
roleName - data source role name to be set.java.sql.SQLException - in case of inability to set role name.default java.lang.String getRoleName()
default void setValidateConnectionOnBorrow(boolean validateConnectionOnBorrow)
throws java.sql.SQLException
Makes the pool validate the connection before returning it to the user by calling the JDBC API "isValid".
Validating the connection each time it's borrowed from the pool has a performance cost because it typically requires a full roundtrip to the database. You can tune how the Oracle JDBC thin driver validates connections using the "oracle.jdbc.defaultConnectionValidation" property (please refer to the JDBC driver javadoc). You may also configure "secondsToTrustIdleConnection" to avoid validating connections that are often active.
Please note that by default, OracleConnection.ConnectionValidation
isn't enabled, but UCP performs the lightweight INBAND_DOWN validation to know if a
connection needs to be drained.
validateConnectionOnBorrow - Whether or not a connection
being borrowed should first be
validated.java.sql.SQLException - in case of inability to set flag.setSecondsToTrustIdleConnectiondefault boolean getValidateConnectionOnBorrow()
default void setSQLForValidateConnection(java.lang.String SQLString)
throws java.sql.SQLException
SQLForValidateConnection property.
This is a SQL command used in conjunction with the
ValidateConnectionOnBorrow property.
The SQL specified should be applicable to the backend database and the
JDBC driver configured. Defaults to null.SQLString - The SQL string used for connection validation.java.sql.SQLException - in case of inability to set SQL string.default java.lang.String getSQLForValidateConnection()
SQLForValidateConnection property.default int getConnectionHarvestTriggerCount()
default void setConnectionHarvestTriggerCount(int connectionHarvestTriggerCount)
throws java.sql.SQLException
The range of valid values is 0 to maxPoolSize. Defaults to
Integer.MAX_VALUE.
Setting the value to Integer.MAX_VALUE disables connection
harvesting.
connectionHarvestTriggerCount - The number of available
connections below which the
connection pool's connection
harvesting will occur.java.sql.SQLException - in case of inability to set that count.default int getConnectionHarvestMaxCount()
connectionHarvestMaxCount.default void setConnectionHarvestMaxCount(int connectionHarvestMaxCount)
throws java.sql.SQLException
The range of valid values is 1 to maxPoolSize. Defaults to 1.
connectionHarvestMaxCount - the maximum number of connections
that may be harvested when the
connection harvesting occurs.java.sql.SQLException - in case of inability to set that count.int getAvailableConnectionsCount()
throws java.sql.SQLException
AvailableConnectionsCountjava.sql.SQLException - in case of inability to set that count.int getBorrowedConnectionsCount()
throws java.sql.SQLException
BorrowedConnectionsCountjava.sql.SQLException - in case of inability to set that count.default java.lang.String getONSConfiguration()
throws java.sql.SQLException
setONSConfiguration(String). This is used by Fast
Connection Failover and Runtime Connection Load Balancing.java.sql.SQLException - in case of inability to set that configuration.default void setONSConfiguration(java.lang.String onsConfigStr)
throws java.sql.SQLException
ons.config). The string contains a list
of name=value pairs separated by a newline
character (\n). The name can be one of nodes,
walletfile, or walletpassword.
The parameter string should at least specify the ONS configuration
nodes attribute as a list of host:port pairs
separated by a comma. SSL would be used when the walletfile
attribute is specified as an Oracle wallet file.
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.
onsConfigStr - The configuration string for remote ONS
subscription.java.sql.SQLException - in case of inability to set that configuration.java.sql.Connection getConnection(java.util.Properties labels)
throws java.sql.SQLException
labels - The requested connection labels.java.sql.SQLException - if a database-access error occurs.java.sql.Connection getConnection(java.lang.String username,
java.lang.String password,
java.util.Properties labels)
throws java.sql.SQLException
username - 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.void registerConnectionLabelingCallback(ConnectionLabelingCallback cbk) throws java.sql.SQLException
cbk - The ConnectionLabelingCallback object to be
registered.java.sql.SQLException - If there is a callback already
registered with the pool.void removeConnectionLabelingCallback()
throws java.sql.SQLException
ConnectionLabelingCallback object registered with the
underlying connection pool, if any.java.sql.SQLException - If callback removal fails.void registerConnectionAffinityCallback(ConnectionAffinityCallback cbk) throws java.sql.SQLException
cbk - Affinity Callback object that must be registered.java.sql.SQLException - If callback registration fails.void removeConnectionAffinityCallback()
throws java.sql.SQLException
ConnectionAffinityCallback object registered on
the connection pool.java.sql.SQLException - If callback removal fails.java.util.Properties getConnectionProperties()
java.lang.String getConnectionProperty(java.lang.String propertyName)
propertyName - The name of the specified property.void setConnectionProperty(java.lang.String name,
java.lang.String value)
throws java.sql.SQLException
oracle.jdbc.pool.OracleDataSource in the Oracle
JDBC driver.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.java.sql.SQLException - If any exception occurred while setting the connection
property.setConnectionFactoryPropertiesvoid setConnectionProperties(java.util.Properties connectionProperties)
throws java.sql.SQLException
oracle.jdbc.pool.OracleDataSource in the Oracle
JDBC driver.connectionProperties - Connection properties to be set on the connection factory class.java.sql.SQLException - If any exception occurred while setting the connection
properties.setConnectionFactoryPropertiesjava.util.Properties getConnectionFactoryProperties()
java.lang.String getConnectionFactoryProperty(java.lang.String propertyName)
propertyName - The name of the specified property.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.
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.java.sql.SQLException - If any exception occurred while setting the connection factory
property.java.lang.IllegalArgumentException - If the property name or value is invalid.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.
factoryProperties - 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.default long getMaxConnectionReuseTime()
setMaxConnectionReuseTime().default void setMaxConnectionReuseTime(long maxConnectionReuseTime)
throws java.sql.SQLException
This property's behaviour is affected by the system property oracle.ucp.timersAffectAllConnections.
For more details go to -
SYSTEM_PROPERTY_TIMERS_AFFECT_ALL_CONNECTIONS.
maxConnectionReuseTime - Maximum connection reuse time (in seconds).java.sql.SQLException - in case of inability to set reuse time.default int getMaxConnectionReuseCount()
setMaxConnectionReuseCount().default void setMaxConnectionReuseCount(int maxConnectionReuseCount)
throws java.sql.SQLException
maxConnectionReuseCount - Maximum connection reuse count.java.sql.SQLException - in case of inability to set reuse time.JDBCConnectionPoolStatistics getStatistics()
void registerConnectionInitializationCallback(ConnectionInitializationCallback cbk) throws java.sql.SQLException
cbk - The ConnectionInitializationCallback
object to be registered.java.sql.SQLException - If there is a callback already
registered with the pool.void unregisterConnectionInitializationCallback()
throws java.sql.SQLException
java.sql.SQLException - If callback removal fails.default ConnectionInitializationCallback getConnectionInitializationCallback()
ConnectionInitializationCallback,
or null if there is no callback registered.default void registerConnectionCreationConsumer(java.util.function.Consumer<oracle.ucp.ConnectionCreationInformation> consumer)
consumer - The Consumer object to be registered.default void unregisterConnectionCreationConsumer()
default java.util.function.Consumer<oracle.ucp.ConnectionCreationInformation> getConnectionCreationConsumer()
Consumer,
or null if there is no Consumer registered.default int getConnectionLabelingHighCost()
setConnectionLabelingHighCostdefault void setConnectionLabelingHighCost(int highCost)
throws java.sql.SQLException
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.highCost - The cost value that identifies a connection as
"high-cost" for connection labeling.java.sql.SQLException - If an exception occurs while setting the cost.default int getHighCostConnectionReuseThreshold()
setConnectionLabelingHighCost,
setHighCostConnectionReuseThresholddefault void setHighCostConnectionReuseThreshold(int threshold)
throws java.sql.SQLException
threshold - The high-cost connection reuse threshold to set.java.sql.SQLException - If any exception occurs while setting the threshold.UCPConnectionBuilder createConnectionBuilder()
default oracle.jdbc.OracleShardingKeyBuilder createShardingKeyBuilder()
default int getConnectionRepurposeThreshold()
default void setConnectionRepurposeThreshold(int threshold)
throws java.sql.SQLException
threshold - connection repurpose threshold to set.java.sql.SQLException - If any exception occurs while setting the threshold.getConnectionRepurposeThresholdjava.util.Properties getPdbRoles()
java.lang.String getServiceName()
default int getSecondsToTrustIdleConnection()
default 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.
With this mode enabled, UCP will do a SOCKET validation on every connection borrow and default driver validation type (can be changed with the "oracle.jdbc.defaultConnectionValidation" system property) after designated seconds to trust idle connection has passed
secondsToTrustIdleConnection - The value of how long a connection can be trusted to skip
connectionValidationOnBorrowjava.sql.SQLException - in case of inability to set these seconds.void reconfigureDataSource(java.util.Properties configuration)
throws java.sql.SQLException
user, password,
description, serviceName, pdbRoles.configuration - the configuration inputjava.sql.SQLException - If an error occurs while configuring the data source.default int getMaxConnectionsPerService()
default int getQueryTimeout()
default void setQueryTimeout(int queryTimeout)
throws java.sql.SQLException
queryTimeout - in secondsjava.sql.SQLException - in case of inability to set that timeout.default int getMaxConnectionsPerShard()
default void setMaxConnectionsPerShard(int maxConnectionsPerShard)
throws java.sql.SQLException
maxConnectionsPerShard - The max number of connections that can be created per shardjava.sql.SQLException - if there is an any exception while setting this parameterdefault void setShardingMode(boolean shardingMode)
throws java.sql.SQLException
shardingMode - Mode of UCP when using a Sharded Database.java.sql.SQLException - in case of inability to set sharding mode.default boolean getShardingMode()
default void setConnectionValidationTimeout(int connectionValidationTimeout)
throws java.sql.SQLException
connectionValidationTimeout - timeout to validate connectionjava.sql.SQLException - if timeout is negativedefault int getConnectionValidationTimeout()
void setSSLContext(javax.net.ssl.SSLContext sslContext)
SSLContext to use as a factory for
SSLEngine objects that carry out the TLS
protocol.
The SSLContext must be initialized before setting it on PoolDataSource. The certificates specified by that initialization will be used in place of any connection properties that would otherwise have specified certificates, such as oracle.jdbc.OracleConnection#CONNECTION_PROPERTY_KEYSTORE key store and oracle.jdbc.OracleConnection#CONNECTION_PROPERTY_TRUSTSTORE trust store property values.
sslContext - SSLContext instance to be used as an SSLEngine factory.void setHostnameResolver(PoolDataSource.HostnameResolver hostnameResolver)
PoolDataSource.HostnameResolver to use by the poolhostnameResolver - HostnameResolver instance to be used as a custom DNS name resolver.default boolean isReadOnlyInstanceAllowed()
default void setReadOnlyInstanceAllowed(boolean readOnlyInstanceAllowed)
throws java.sql.SQLException
readOnlyInstanceAllowed - whether to allow connection borrow to a read-only instance or notjava.sql.SQLException - if unable to set property valuevoid setTokenSupplier(java.util.function.Supplier<? extends oracle.jdbc.AccessToken> tokenSupplier)
throws java.sql.SQLException
Sets a supplier function that generates an access token when creating a
connection with this DataSource. The supplier function
is invoked each time this DataSource creates a
connection. Instances of AccessToken that are output by the
supplier must represent a token type that is supported by Oracle Database
for client authentication. The supplier must be thread safe.
It is invalid to configure this DataSource with both a token
supplier and with a user name or password. If invocations of
setUser(String), setPassword(String),
setConnectionProperties(java.util.Properties), or
setConnectionProperty(String, String) have configured this
DataSource with a user name or password, and an invocation of
this method has also configured a token supplier, then a
SQLException indicating an invalid configuration is thrown when
creating a connection with this datasource.
Note that AccessToken.createJsonWebTokenCache(Supplier) can be
called to create a thread safe Supplier that caches tokens from
a user defined Supplier.
tokenSupplier - Token supplying function. Not null.java.lang.NullPointerException - If the tokenSupplier is null.java.sql.SQLException - if unable to set property valuedefault boolean isCreateConnectionInBorrowThread()
setCreateConnectionInBorrowThreaddefault void setCreateConnectionInBorrowThread(boolean createConnectionInBorrowThread)
throws java.sql.SQLException
Set this flag to true to make UCP use the borrowing thread to create new connections. By default, connections are created in the background. The only reason why you may want to set this to "true" is to make a connection request fail-fast if the driver throws an exception while connecting; otherwise, the background task will keep trying until the connection wait timeout expires.
If this property is set to false, a pool waits no longer than a designated connection wait duration no matter
how long it takes to create a new connection to grow a pool, if no connection is available at this moment.
If this property is set to true, then in this backward compatibility mode a pool waits for a connection to be
synchronously created in a borrow thread, and the waiting time can take longer than connectionWaitDuration.
For connectionWaitDuration please refer to
setConnectionWaitDuration(java.time.Duration).
createConnectionInBorrowThread - if true, create connections in a borrow thread.java.sql.SQLException - if unable to set property value.default boolean isCommitOnConnectionReturn()
default void setCommitOnConnectionReturn(boolean commit)
throws java.sql.SQLException
commit - 'true' to commit, 'false' to rollback. The default is 'true'.java.sql.SQLException - if an error occurs while setting the propertyvoid setPoolProperty(java.lang.String key,
java.lang.String value)
throws java.sql.SQLException
For example:
datasource.setPoolProperty(PoolProperty.MIN_POOL_SIZE, "10");
key - must be one of the PoolProperty enum.value - property value to set.java.sql.SQLException - if unable to set property.void setPoolProperty(oracle.ucp.config.PoolProperty poolProperty,
java.lang.Object value,
int errorCode)
throws java.sql.SQLException
poolProperty - property to set.value - value to set - can be Integer, Long, String, etc - in accordance with property's type.errorCode - vendor code for SQL exception.java.sql.SQLException - exception to throw, if something wrong happened.void setPoolProperties(java.util.Properties props)
throws java.sql.SQLException
java.util.Properties collection???
for example:
Properties props = new Properties()
props.setProperty(PoolProperty.MIN_POOL_SIZE, "10")
props.setProperty(PoolProperty.MAX_POOL_SIZE, "100")
poolDataSource.setPoolProperties(props)
props - properties to set.java.sql.SQLException - if unable to set property.void setProperties(java.lang.String propsAsString)
throws java.sql.SQLException
Configure UCP Pool properties through a comma separated list of properties.
For example:
poolDataSource.setProperties("minPoolSize=10,maxPoolSize=20");
For property names please refer to the following interface:
propsAsString - comma separated list of properties.java.sql.SQLException - if unable to set propertyPropertyNamesjava.lang.String getPoolProperty(java.lang.String key)
throws java.sql.SQLException
key - pool property which value to get.java.sql.SQLException - if unable to set propertyoracle.ucp.config.PoolProperties getPoolProperties()