public interface PoolDataSource extends javax.sql.DataSource, Diagnosable
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_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.
|
static java.lang.String |
UCP_ABANDONED_CONNECTION_TIMEOUT |
static java.lang.String |
UCP_CONNECTION_AFFINITY_CALLBACK |
static java.lang.String |
UCP_CONNECTION_CREATION_CONSUMER |
static java.lang.String |
UCP_CONNECTION_FACTORY_CLASS_NAME |
static java.lang.String |
UCP_CONNECTION_FACTORY_PROPERTIES |
static java.lang.String |
UCP_CONNECTION_HARVEST_MAX_COUNT |
static java.lang.String |
UCP_CONNECTION_HARVEST_TRIGGER_COUNT |
static java.lang.String |
UCP_CONNECTION_INITIALIZATION_CALLBACK |
static java.lang.String |
UCP_CONNECTION_LABELING_CALLBACK |
static java.lang.String |
UCP_CONNECTION_LABELING_HIGH_COST |
static java.lang.String |
UCP_CONNECTION_POOL_NAME |
static java.lang.String |
UCP_CONNECTION_PROPERTIES |
static java.lang.String |
UCP_CONNECTION_REPURPOSE_THRESHOLD |
static java.lang.String |
UCP_CONNECTION_VALIDATION_TIMEOUT |
static java.lang.String |
UCP_CONNECTION_WAIT_DURATION |
static java.lang.String |
UCP_CONNECTION_WAIT_TIMEOUT |
static java.lang.String |
UCP_DATA_SOURCE_FROM_CONFIGURATION |
static java.lang.String |
UCP_DATA_SOURCE_NAME |
static java.lang.String |
UCP_DATABASE_NAME |
static java.lang.String |
UCP_DESCRIPTION |
static java.lang.String |
UCP_FAST_CONNECTION_FAILOVER_ENABLED |
static java.lang.String |
UCP_HIGH_COST_CONNECTION_REUSE_THRESHOLD |
static java.lang.String |
UCP_INACTIVE_CONNECTION_TIMEOUT |
static java.lang.String |
UCP_INITIAL_POOL_SIZE |
static java.lang.String |
UCP_LOGIN_TIMEOUT |
static java.lang.String |
UCP_MAX_CONNECTION_REUSE_COUNT |
static java.lang.String |
UCP_MAX_CONNECTION_REUSE_TIME |
static java.lang.String |
UCP_MAX_CONNECTIONS_PER_SERVICE |
static java.lang.String |
UCP_MAX_CONNECTIONS_PER_SHARD |
static java.lang.String |
UCP_MAX_IDLE_TIME |
static java.lang.String |
UCP_MAX_POOL_SIZE |
static java.lang.String |
UCP_MAX_STATEMENTS |
static java.lang.String |
UCP_MIN_POOL_SIZE |
static java.lang.String |
UCP_NETWORK_PROTOCOL |
static java.lang.String |
UCP_NTH_RETURNED_CONNECTION_TO_VALIDATE |
static java.lang.String |
UCP_ONS_CONFIGURATION |
static java.lang.String |
UCP_PASSWORD |
static java.lang.String |
UCP_PDB_ROLES |
static java.lang.String |
UCP_PORT_NUMBER |
static java.lang.String |
UCP_PROPERTY_CYCLE |
static java.lang.String |
UCP_READONLY_INSTANCE_ALLOWED |
static java.lang.String |
UCP_ROLE_NAME |
static java.lang.String |
UCP_SECONDS_TO_TRUST_IDLE_CONNECTION |
static java.lang.String |
UCP_SERVER_NAME |
static java.lang.String |
UCP_SERVICE_NAME |
static java.lang.String |
UCP_SHARDING_MODE |
static java.lang.String |
UCP_SQL_FOR_VALIDATE_CONNECTION |
static java.lang.String |
UCP_TIME_TO_LIVE_CONNECTION_TIMEOUT |
static java.lang.String |
UCP_TIMEOUT_CHECK_INTERVAL |
static java.lang.String |
UCP_URL |
static java.lang.String |
UCP_USER |
static java.lang.String |
UCP_VALIDATE_CONNECTION_ON_BORROW |
| Modifier and Type | Method and Description |
|---|---|
UCPConnectionBuilder |
createConnectionBuilder()
Creates a new UCPConnectionBuilder instance.
|
default oracle.jdbc.OracleShardingKeyBuilder |
createShardingKeyBuilder()
Creates a new OracleShardingKeyBuilder instance
|
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.
|
java.lang.String |
getConnectionFactoryClassName()
Gets the Connection Factory class name.
|
java.util.Properties |
getConnectionFactoryProperties()
Gets the connection factory properties that are set on this
data source.
|
java.lang.String |
getConnectionFactoryProperty(java.lang.String propertyName)
Gets the specified connection factory property that are set on
this data source.
|
int |
getConnectionHarvestMaxCount()
Gets the maximum number of connections that may be harvested when the
connection harvesting occurs.
|
int |
getConnectionHarvestTriggerCount()
Gets the number of available connections below which the connection
pool's connection harvesting will occur.
|
ConnectionInitializationCallback |
getConnectionInitializationCallback()
Obtains the registered connection initialization callback, if any.
|
int |
getConnectionLabelingHighCost()
Obtains the cost value which identifies a connection as "high-cost"
for connection labeling.
|
java.lang.String |
getConnectionPoolName()
Gets the connection pool name.
|
java.util.Properties |
getConnectionProperties()
Gets the connection properties that are set on this data source.
|
java.lang.String |
getConnectionProperty(java.lang.String propertyName)
Gets the specified connection property that are set on
this data source.
|
int |
getConnectionRepurposeThreshold()
Gets the connection repurpose threshold for the pool.
|
int |
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.
|
java.lang.String |
getDatabaseName()
Gets the database name.
|
java.lang.String |
getDataSourceName()
Gets the data source name.
|
java.lang.String |
getDescription()
Gets the data source description.
|
boolean |
getFastConnectionFailoverEnabled()
Checks if Fast Connection Failover is enabled.
|
int |
getHighCostConnectionReuseThreshold()
Obtains the high-cost connection reuse threshold property
value for connection labeling.
|
int |
getInactiveConnectionTimeout()
Gets the inactive connection timeout.
|
int |
getInitialPoolSize()
Gets the initial pool size.
|
int |
getMaxConnectionReuseCount()
Gets the maximum connection reuse count property value.
|
long |
getMaxConnectionReuseTime()
Gets the maximum connection reuse time property value.
|
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
from this connection pool.
|
int |
getMaxIdleTime()
Gets the maximum idle time.
|
int |
getMaxPoolSize()
Gets the maximum number of connections that the connection pool will
maintain.
|
int |
getMaxStatements()
Gets the maximum number of statements that may be pooled or cached on a
Connection.
|
int |
getMinPoolSize()
Gets the minimum number of connections that the connection pool will
maintain.
|
java.lang.String |
getNetworkProtocol()
Gets the data source network protocol.
|
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
|
int |
getPortNumber()
Gets the database port number.
|
int |
getPropertyCycle()
Gets the 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.
|
java.lang.String |
getRoleName()
Gets the data source role name.
|
int |
getSecondsToTrustIdleConnection()
Gets the seconds To Trust Idle Connection value.
|
java.lang.String |
getServerName()
Gets the database server name.
|
java.lang.String |
getServiceName()
Gets the service name set on this data source
|
boolean |
getShardingMode()
Returns the mode of UCP when UCP is using a Sharded Database.
|
java.lang.String |
getSQLForValidateConnection()
Gets the value of the
SQLForValidateConnection property. |
JDBCConnectionPoolStatistics |
getStatistics()
Gets the statistics of the connection pool.
|
int |
getTimeoutCheckInterval()
Gets the timeout check interval (in seconds).
|
int |
getTimeToLiveConnectionTimeout()
Gets the maximum time (in seconds) a connection may remain in-use.
|
java.lang.String |
getURL()
Gets the URL for this data source.
|
java.lang.String |
getUser()
Gets the user name for this data source.
|
boolean |
getValidateConnectionOnBorrow()
Returns whether or not a connection being borrowed should first be
validated.
|
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. |
void |
setAbandonedConnectionTimeout(int abandonedConnectionTimeout)
Sets the abandoned connection timeout.
|
void |
setConnectionFactoryClassName(java.lang.String factoryClassName)
Sets the Connection Factory class name.
|
void |
setConnectionFactoryProperties(java.util.Properties factoryProperties)
Sets the connection factory properties on the connection factory.
|
void |
setConnectionFactoryProperty(java.lang.String name,
java.lang.String value)
Sets a connection factory property on the connection factory.
|
void |
setConnectionHarvestMaxCount(int connectionHarvestMaxCount)
Sets the maximum number of connections that may be harvested when the
connection harvesting occurs.
|
void |
setConnectionHarvestTriggerCount(int connectionHarvestTriggerCount)
Sets the number of available connections below which the connection
pool's connection harvesting will occur.
|
void |
setConnectionLabelingHighCost(int highCost)
Sets the cost value which identifies a connection as "high-cost"
for connection labeling.
|
void |
setConnectionPoolName(java.lang.String connectionpoolName)
Sets the connection pool name.
|
void |
setConnectionProperties(java.util.Properties connectionProperties)
Sets the connection properties on the connection factory.
|
void |
setConnectionProperty(java.lang.String name,
java.lang.String value)
Sets a connection property on the connection factory.
|
void |
setConnectionRepurposeThreshold(int threshold)
Sets the connection repurpose threshold for the pool.
|
void |
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 |
setDatabaseName(java.lang.String databaseName)
Sets the database name.
|
void |
setDataSourceName(java.lang.String dataSourceName)
Sets the data source name.
|
void |
setDescription(java.lang.String description)
Sets the data source description.
|
void |
setFastConnectionFailoverEnabled(boolean failoverEnabled)
Enables Fast Connection Failover (FCF) for the connection pool accessed
using this pool-enabled data source.
|
void |
setHighCostConnectionReuseThreshold(int threshold)
Sets the high-cost connection reuse threshold for connection labeling.
|
void |
setHostnameResolver(PoolDataSource.HostnameResolver hostnameResolver)
Specifies a
PoolDataSource.HostnameResolver to use by the pool |
void |
setInactiveConnectionTimeout(int inactivityTimeout)
Sets the inactive connection timeout.
|
void |
setInitialPoolSize(int initialPoolSize)
Sets the initial pool size.
|
void |
setMaxConnectionReuseCount(int maxConnectionReuseCount)
Sets the maximum connection reuse count property.
|
void |
setMaxConnectionReuseTime(long maxConnectionReuseTime)
Sets the maximum connection reuse time property.
|
void |
setMaxConnectionsPerShard(int maxConnectionsPerShard)
Sets the max number of connections that can be created per shard from this
connection pool.
|
void |
setMaxIdleTime(int idleTime)
Sets the maximum idle time for available connections in the pool.
|
void |
setMaxPoolSize(int maxPoolSize)
Sets the maximum number of connections.
|
void |
setMaxStatements(int maxStatements)
Sets the maximum number of statements that may be pooled or cached on
a connection.
|
void |
setMinPoolSize(int minPoolSize)
Sets the minimum number of connections.
|
void |
setNetworkProtocol(java.lang.String networkProtocol)
Sets the data source network protocol.
|
void |
setONSConfiguration(java.lang.String onsConfigStr)
Sets the configuration string used for remote ONS subscription.
|
void |
setPassword(java.lang.String pd)
Sets the password with which connections have to be obtained.
|
void |
setPortNumber(int portNumber)
Sets the database port number.
|
void |
setPropertyCycle(int propertyCycle)
Sets the 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 |
setReadOnlyInstanceAllowed(boolean readOnlyInstanceAllowed)
Sets the read-only instance allowed value on the datasource.
|
void |
setRoleName(java.lang.String roleName)
Sets the data source role name.
|
void |
setSecondsToTrustIdleConnection(int secondsToTrustIdleConnection)
Sets the time in seconds to trust an idle connection to skip a validation
test.
|
void |
setServerName(java.lang.String serverName)
Sets the database server name.
|
void |
setShardingMode(boolean shardingMode)
This API changes the mode of UCP when UCP is using a Sharded Database.
|
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. |
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 |
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. |
void |
setURL(java.lang.String url)
Sets the URL that the data source uses to obtain connections to the
database.
|
void |
setUser(java.lang.String userName)
Sets the user name with which connections have to be obtained.
|
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 UCP_USER
static final java.lang.String UCP_URL
static final java.lang.String UCP_PASSWORD
static final java.lang.String UCP_SERVER_NAME
static final java.lang.String UCP_PORT_NUMBER
static final java.lang.String UCP_DATABASE_NAME
static final java.lang.String UCP_DATA_SOURCE_NAME
static final java.lang.String UCP_DESCRIPTION
static final java.lang.String UCP_NETWORK_PROTOCOL
static final java.lang.String UCP_ROLE_NAME
static final java.lang.String UCP_CONNECTION_FACTORY_CLASS_NAME
static final java.lang.String UCP_CONNECTION_PROPERTIES
static final java.lang.String UCP_CONNECTION_FACTORY_PROPERTIES
static final java.lang.String UCP_VALIDATE_CONNECTION_ON_BORROW
static final java.lang.String UCP_SQL_FOR_VALIDATE_CONNECTION
static final java.lang.String UCP_CONNECTION_POOL_NAME
static final java.lang.String UCP_INITIAL_POOL_SIZE
static final java.lang.String UCP_MIN_POOL_SIZE
static final java.lang.String UCP_MAX_POOL_SIZE
static final java.lang.String UCP_NTH_RETURNED_CONNECTION_TO_VALIDATE
static final java.lang.String UCP_ABANDONED_CONNECTION_TIMEOUT
static final java.lang.String UCP_TIME_TO_LIVE_CONNECTION_TIMEOUT
static final java.lang.String UCP_INACTIVE_CONNECTION_TIMEOUT
static final java.lang.String UCP_MAX_IDLE_TIME
static final java.lang.String UCP_TIMEOUT_CHECK_INTERVAL
static final java.lang.String UCP_PROPERTY_CYCLE
static final java.lang.String UCP_MAX_STATEMENTS
static final java.lang.String UCP_CONNECTION_WAIT_TIMEOUT
static final java.lang.String UCP_CONNECTION_WAIT_DURATION
static final java.lang.String UCP_MAX_CONNECTION_REUSE_TIME
static final java.lang.String UCP_MAX_CONNECTION_REUSE_COUNT
static final java.lang.String UCP_CONNECTION_HARVEST_TRIGGER_COUNT
static final java.lang.String UCP_CONNECTION_HARVEST_MAX_COUNT
static final java.lang.String UCP_FAST_CONNECTION_FAILOVER_ENABLED
static final java.lang.String UCP_ONS_CONFIGURATION
static final java.lang.String UCP_SECONDS_TO_TRUST_IDLE_CONNECTION
static final java.lang.String UCP_MAX_CONNECTIONS_PER_SERVICE
static final java.lang.String UCP_LOGIN_TIMEOUT
static final java.lang.String UCP_SERVICE_NAME
static final java.lang.String UCP_PDB_ROLES
static final java.lang.String UCP_CONNECTION_AFFINITY_CALLBACK
static final java.lang.String UCP_CONNECTION_INITIALIZATION_CALLBACK
static final java.lang.String UCP_CONNECTION_CREATION_CONSUMER
static final java.lang.String UCP_CONNECTION_LABELING_CALLBACK
static final java.lang.String UCP_CONNECTION_LABELING_HIGH_COST
static final java.lang.String UCP_CONNECTION_REPURPOSE_THRESHOLD
static final java.lang.String UCP_HIGH_COST_CONNECTION_REUSE_THRESHOLD
static final java.lang.String UCP_DATA_SOURCE_FROM_CONFIGURATION
static final java.lang.String UCP_MAX_CONNECTIONS_PER_SHARD
static final java.lang.String UCP_SHARDING_MODE
static final java.lang.String UCP_CONNECTION_VALIDATION_TIMEOUT
static final java.lang.String UCP_READONLY_INSTANCE_ALLOWED
int getInitialPoolSize()
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.int getMinPoolSize()
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.int getMaxPoolSize()
void setMaxPoolSize(int maxPoolSize)
throws java.sql.SQLException
The range of valid values is 1 to Integer.MAX_VALUE.
Default is 8 connections.
maxPoolSize - The maximum number of connections.java.sql.SQLException - in case of inability to set max pool size.int getInactiveConnectionTimeout()
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.
inactivityTimeout - The inactive connection timeout in seconds.java.sql.SQLException - in case of inability to set timeout.int getAbandonedConnectionTimeout()
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.
A borrow request may end up creating a new JDBC connection. Therefore, starting in 23.1, the value returned by this method may be larger than the configured one because UCP adjusts it so that it's always equal or larger than the CONNECT_TIMEOUT of the JDBC driver.
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.
A borrow request may end up creating a new JDBC connection. Therefore, starting in 23.1, the value returned by this method may be larger than the configured one because UCP adjusts it so that it's always equal or larger than the CONNECT_TIMEOUT of the JDBC driver.
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.int getTimeToLiveConnectionTimeout()
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.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.int getTimeoutCheckInterval()
timeInterval (in seconds) between
checks to enforce the timeout properties.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.boolean getFastConnectionFailoverEnabled()
true if Fast Connection Failover is enabled;
false if not.java.lang.String getConnectionFactoryClassName()
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.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.int getMaxStatements()
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.int getMaxIdleTime()
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.int getPropertyCycle()
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.java.lang.String getConnectionPoolName()
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.java.lang.String getURL()
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.java.lang.String getUser()
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()
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.java.lang.String getServerName()
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.int getPortNumber()
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.java.lang.String getDatabaseName()
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.java.lang.String getDataSourceName()
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.java.lang.String getDescription()
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.java.lang.String getNetworkProtocol()
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.java.lang.String getRoleName()
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.
validateConnectionOnBorrow - Whether or not a connection
being borrowed should first be
validated.java.sql.SQLException - in case of inability to set flag.setSecondsToTrustIdleConnectionboolean getValidateConnectionOnBorrow()
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.java.lang.String getSQLForValidateConnection()
SQLForValidateConnection property.int getConnectionHarvestTriggerCount()
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.int getConnectionHarvestMaxCount()
connectionHarvestMaxCount.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.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.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.long getMaxConnectionReuseTime()
setMaxConnectionReuseTime().void setMaxConnectionReuseTime(long maxConnectionReuseTime)
throws java.sql.SQLException
maxConnectionReuseTime - Maximum connection reuse time (in seconds).java.sql.SQLException - in case of inability to set reuse time.int getMaxConnectionReuseCount()
setMaxConnectionReuseCount().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.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.int getConnectionLabelingHighCost()
setConnectionLabelingHighCostvoid 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.int getHighCostConnectionReuseThreshold()
setConnectionLabelingHighCost,
setHighCostConnectionReuseThresholdvoid 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()
int getConnectionRepurposeThreshold()
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()
int getSecondsToTrustIdleConnection()
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
* @param 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.int getMaxConnectionsPerService()
int getQueryTimeout()
void setQueryTimeout(int queryTimeout)
throws java.sql.SQLException
queryTimeout - in secondsjava.sql.SQLException - in case of inability to set that timeout.int getMaxConnectionsPerShard()
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 parametervoid 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.boolean getShardingMode()
void setConnectionValidationTimeout(int connectionValidationTimeout)
throws java.sql.SQLException
connectionValidationTimeout - timeout to validate connectionjava.sql.SQLException - if tiomeout is negativeint 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.boolean isReadOnlyInstanceAllowed()
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 value