Interface UcpDataSourceConfig

All Superinterfaces:
ConnectionConfig, NamedService, Prototype.Api, ProviderConfig
All Known Implementing Classes:
UcpDataSourceConfig.BuilderBase.UcpDataSourceConfigImpl

public interface UcpDataSourceConfig extends Prototype.Api, ConnectionConfig
UCP specific configuration for DataSource.

Properties are limited to Map<String,String>. PoolDataSource.setHostnameResolver(oracle.ucp.jdbc.PoolDataSource.HostnameResolver), PoolDataSource.setSSLContext(javax.net.ssl.SSLContext) and PoolDataSource.setTokenSupplier(java.util.function.Supplier) methods are not supported.

Oracle Database 23ai compliant config.

See Also:
  • Method Details

    • builder

      static UcpDataSourceConfig.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static UcpDataSourceConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      @Deprecated static UcpDataSourceConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static UcpDataSourceConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • name

      String name()
      Name of this provider.
      Specified by:
      name in interface NamedService
      Returns:
      the provider name
    • xaDataSource

      Optional<Boolean> xaDataSource()
      Support for distributed transactions. PoolXADataSource instance is returned when true, PoolDataSource instance is returned when false. Default value is false.
      Returns:
      whether distributed transactions are supported.
    • abandonedConnectionTimeout

      Optional<Integer> abandonedConnectionTimeout()
      Sets the abandoned connection timeout. See PoolDataSource.setAbandonedConnectionTimeout(int) for details.
      Returns:
      the abandoned connection timeout.
    • commitOnConnectionReturn

      Optional<Boolean> commitOnConnectionReturn()
      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. See PoolDataSource.setCommitOnConnectionReturn(boolean) for details.
      Returns:
      true to commit, false to rollback, default value is true.
    • connectionFactoryClassName

      Optional<String> connectionFactoryClassName()
      Sets the connection factory class name. See PoolDataSource.setConnectionFactoryClassName(String) for details.
      Returns:
      the connection factory class name
    • connectionFactoryProperties

      Optional<Map<String,String>> connectionFactoryProperties()
      Sets the connection factory properties on the connection factory. See PoolDataSource.setConnectionFactoryProperties(java.util.Properties) for details.
      Returns:
      the connection factory properties
    • connectionHarvestMaxCount

      Optional<Integer> connectionHarvestMaxCount()
      Sets the maximum number of connections that may be harvested when the connection harvesting occurs. See PoolDataSource.setConnectionHarvestMaxCount(int) for details.
      Returns:
      the maximum number of connections that may be harvested
    • connectionHarvestTriggerCount

      Optional<Integer> connectionHarvestTriggerCount()
      Sets the number of available connections below which the connection pool's connection harvesting will occur. See PoolDataSource.setConnectionHarvestTriggerCount(int) for details.
      Returns:
      the number of available connections below which the connection harvesting will occur
    • connectionLabelingHighCost

      Optional<Integer> connectionLabelingHighCost()
      Sets the cost value which identifies a connection as "high-cost" for connection labeling. See PoolDataSource.setConnectionLabelingHighCost(int) for details.
      Returns:
      the cost value
    • connectionPoolName

      Optional<String> connectionPoolName()
      Sets the connection pool name. See PoolDataSource.setConnectionPoolName(String) for details.
      Returns:
      the connection pool name
    • connectionProperties

      Optional<Map<String,String>> connectionProperties()
      Sets the connection properties on the connection factory. See PoolDataSource.setConnectionProperties(java.util.Properties) for details.
      Returns:
      the connection properties
    • connectionRepurposeThreshold

      Optional<Integer> connectionRepurposeThreshold()
      Sets the connection repurpose threshold for the pool. See PoolDataSource.setConnectionRepurposeThreshold(int) for details.
      Returns:
      the connection repurpose threshold
    • connectionValidationTimeout

      Optional<Integer> connectionValidationTimeout()
      Sets the connection validation timeout in seconds. See PoolDataSource.setConnectionValidationTimeout(int) for details.
      Returns:
      the connection validation timeout
    • connectionWaitDuration

      Optional<Duration> connectionWaitDuration()
      Configures how much time a connection request call may wait before it either successfully returns a connection or throws an exception. See PoolDataSource.setConnectionWaitDuration(java.time.Duration) for details.
      Returns:
      the connection wait duration
    • createConnectionInBorrowThread

      Optional<Boolean> createConnectionInBorrowThread()
      Set this flag to true to make UCP use the borrowing thread to create new connections. See PoolDataSource.setCreateConnectionInBorrowThread(boolean) for details.
      Returns:
      whether to use the borrowing thread to create new connections
    • databaseName

      Optional<String> databaseName()
      Sets the database name. See PoolDataSource.setDatabaseName(String) for details.
      Returns:
      the database name
    • dataSourceName

      Optional<String> dataSourceName()
      Sets the data source name. See PoolDataSource.setDataSourceName(String) for details.
      Returns:
      the data source name
    • description

      Optional<String> description()
      Sets the data source description. See PoolDataSource.setDescription(String) for details.
      Returns:
      the data source description
    • fastConnectionFailoverEnabled

      Optional<Boolean> fastConnectionFailoverEnabled()
      Enables Fast Connection Failover (FCF) for the connection pool accessed using this pool-enabled data source. See PoolDataSource.setFastConnectionFailoverEnabled(boolean) for details.
      Returns:
      whether the Fast Connection Failover (FCF) is enabled
    • highCostConnectionReuseThreshold

      Optional<Integer> highCostConnectionReuseThreshold()
      Sets the high-cost connection reuse threshold for connection labeling. See PoolDataSource.setHighCostConnectionReuseThreshold(int) for details.
      Returns:
      the high-cost connection reuse threshold
    • inactiveConnectionTimeout

      Optional<Integer> inactiveConnectionTimeout()
      Sets the inactive connection timeout. See PoolDataSource.setInactiveConnectionTimeout(int) for details.
      Returns:
      the inactive connection timeout
    • initialPoolSize

      Optional<Integer> initialPoolSize()
      Sets the initial pool size. See PoolDataSource.setInitialPoolSize(int) for details.
      Returns:
      the initial pool size
    • maxConnectionReuseCount

      Optional<Integer> maxConnectionReuseCount()
      Sets the maximum connection reuse count. See PoolDataSource.setMaxConnectionReuseCount(int) for details.
      Returns:
      the maximum connection reuse count
    • maxConnectionReuseTime

      Optional<Long> maxConnectionReuseTime()
      Sets the maximum connection reuse time in seconds. See PoolDataSource.setMaxConnectionReuseTime(long) for details.
      Returns:
      the maximum connection reuse time
    • maxConnectionsPerShard

      Optional<Integer> maxConnectionsPerShard()
      Sets the max number of connections that can be created per shard from this connection pool. See PoolDataSource.setMaxConnectionsPerShard(int) for details.
      Returns:
      the max number of connections to be created
    • maxIdleTime

      Optional<Integer> maxIdleTime()
      Sets the maximum idle time for available connections in the pool in seconds. See PoolDataSource.setMaxIdleTime(int) for details.
      Returns:
      the maximum idle time
    • maxPoolSize

      Optional<Integer> maxPoolSize()
      Sets the maximum number of connections. See PoolDataSource.setMaxPoolSize(int) for details.
      Returns:
      the maximum number of connections
    • minPoolSize

      Optional<Integer> minPoolSize()
      Sets the minimum number of connections. See PoolDataSource.setMinPoolSize(int) for details.
      Returns:
      the minimum number of connections
    • maxStatements

      Optional<Integer> maxStatements()
      Sets the maximum number of statements that may be pooled or cached on a connection. See PoolDataSource.setMaxStatements(int) for details.
      Returns:
      the maximum number of statements
    • minIdle

      Optional<Integer> minIdle()
      Sets the minimum number of idle connections. See PoolDataSource.setMinIdle(int) for details.
      Returns:
      the minimum number of idle connections
    • networkProtocol

      Optional<String> networkProtocol()
      Sets the data source network protocol. See PoolDataSource.setNetworkProtocol(String) for details.
      Returns:
      the data source network protocol
    • onsConfiguration

      Optional<String> onsConfiguration()
      Sets the configuration string used for remote ONS subscription. See PoolDataSource.setONSConfiguration(String) for details.
      Returns:
      the configuration string
    • portNumber

      Optional<Integer> portNumber()
      Sets the database port number. See PoolDataSource.setPortNumber(int) for details.
      Returns:
      the database port number
    • propertyCycle

      Optional<Integer> propertyCycle()
      Sets the property cycle in seconds. See PoolDataSource.setPropertyCycle(int) for details.
      Returns:
      the property cycle
    • queryTimeout

      Optional<Integer> queryTimeout()
      Sets the number of seconds the driver will wait for a Statement object to execute to the given number of seconds. See PoolDataSource.setQueryTimeout(int) for details.
      Returns:
      the query timeout
    • readOnlyInstanceAllowed

      Optional<Boolean> readOnlyInstanceAllowed()
      Sets the read-only instance allowed value on the datasource. See PoolDataSource.setReadOnlyInstanceAllowed(boolean) for details.
      Returns:
      the read-only instance allowed value
    • roleName

      Optional<String> roleName()
      Sets the data source role name. See PoolDataSource.setRoleName(String) for details.
      Returns:
      the data source role name
    • secondsToTrustIdleConnection

      Optional<Integer> secondsToTrustIdleConnection()
      Sets the time to trust an idle connection to skip a validation test in seconds. See PoolDataSource.setSecondsToTrustIdleConnection(int) for details.
      Returns:
      the time in seconds
    • serverName

      Optional<String> serverName()
      Sets the database server name. See PoolDataSource.setServerName(String) for details.
      Returns:
      the database server name
    • shardingMode

      Optional<Boolean> shardingMode()
      Change the mode of UCP when UCP is using a Sharded Database. See PoolDataSource.setShardingMode(boolean) for details.
      Returns:
      change the sharding mode
    • sqlForValidateConnection

      Optional<String> sqlForValidateConnection()
      Sets the SQL statement to validate the database connection. See PoolDataSource.setSQLForValidateConnection(String) for details.
      Returns:
      the SQL statement
    • timeoutCheckInterval

      Optional<Integer> timeoutCheckInterval()
      Sets the timeout check interval in seconds. See PoolDataSource.setTimeoutCheckInterval(int) for details.
      Returns:
      the timeout check interval
    • timeToLiveConnectionTimeout

      Optional<Integer> timeToLiveConnectionTimeout()
      Sets the maximum time a connection may remain in-use in seconds. See PoolDataSource.setTimeToLiveConnectionTimeout(int) for details.
      Returns:
      the maximum time a connection may remain in-use
    • validateConnectionOnBorrow

      Optional<Boolean> validateConnectionOnBorrow()
      Makes the pool validate the connection before returning it to the user by calling the JDBC API isValid. See PoolDataSource.setValidateConnectionOnBorrow(boolean) for details.
      Returns:
      whether to validate the connection before returning it to the user
    • type

      default String type()
      Type of this provider.
      Specified by:
      type in interface NamedService
      Returns:
      provider type - "ucp"