Class UCPDataSource
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource,org.springframework.beans.factory.InitializingBean
This decorator of PoolDataSource
allows UCP to be configured as the pooled datasource in Spring Boot
applications using Autoconfigure.
In order for Spring to use this data source, the following attribute needs
to be set: spring.datasource.type=oracle.ucp.jdbc.UCPDataSource
Spring injects both camel-case notation or slash separated. Eg: both maxPoolSize and max-pool-size will update maxPoolSize attribute.
Common attributes with other connection pool implementors:
- spring.datasource.url
- spring.datasource.username
- spring.datasource.password
- spring.datasource.driver-class-name
Common attribute, to use this bean:
- spring.datasource.type=oracle.ucp.jdbc.UCPDataSource
Non-optional attribute, specific to UCP:
- spring.datasource.ucp.connection-factory-class-name
Optional attributes, specific to UCP:
- spring.datasource.ucp.server-name
- spring.datasource.ucp.port-number
- spring.datasource.ucp.database-name
- spring.datasource.ucp.data-source-name
- spring.datasource.ucp.description
- spring.datasource.ucp.network-protocol
- spring.datasource.ucp.role-name
- spring.datasource.ucp.validate-connection-on-borrow
- spring.datasource.ucp.sql-for-validate-connection
- spring.datasource.ucp.connection-pool-name
- spring.datasource.ucp.initial-pool-size
- spring.datasource.ucp.min-pool-size
- spring.datasource.ucp.max-pool-size
- spring.datasource.ucp.abandoned-connection-timeout
- spring.datasource.ucp.time-to-live-connection-timeout
- spring.datasource.ucp.inactive-connection-timeout
- spring.datasource.ucp.max-idle-time
- spring.datasource.ucp.timeout-check-interval
- spring.datasource.ucp.property-cycle
- spring.datasource.ucp.max-statements
- spring.datasource.ucp.connection-wait-timeout
- spring.datasource.ucp.max-connection-reuse-time
- spring.datasource.ucp.max-connection-reuse-count
- spring.datasource.ucp.connection-harvest-trigger-count
- spring.datasource.ucp.connection-harvest-max-count
- spring.datasource.ucp.fast-connection-fail-over-enabled
- spring.datasource.ucp.ons-configuration
- spring.datasource.ucp.seconds-to-trust-idle-connection
- spring.datasource.ucp.login-timeout
- spring.datasource.ucp.connection-labeling-high-cost
- spring.datasource.ucp.connection-repurpose-threshold
- spring.datasource.ucp.high-cost-connection-reuse-threshold
- spring.datasource.ucp.max-connections-per-shard
- spring.datasource.ucp.sharding-mode
- spring.datasource.ucp.connection-validation-timeout
This feature is now deprecated in 23ai,
please use spring boot version 2.4 or higher,
to use the auto-configure feature in spring boot,
use spring.datasource.type=oracle.ucp.jdbc.PoolDataSource
and rest of the ucp properties can be set similarly
using 'spring.datasource.oracleucp' prefix
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.After the bean has all its properties injected, this method creates thePoolDataSourcedecorated instance.Deprecated.Returns the datasource@Beanreference.Deprecated.getConnection(String username, String password) Deprecated.intDeprecated.Deprecated.Deprecated.Deprecated.Returns the reference to the instantiatedPoolDataSource.booleanisWrapperFor(Class<?> iface) Deprecated.voidsetAbandonedConnectionTimeout(int abandonedConnectionTimeout) Deprecated.voidsetConnectionFactoryClassName(String connectionFactoryClassName) Deprecated.voidsetConnectionHarvestMaxCount(int connectionHarvestMaxCount) Deprecated.voidsetConnectionHarvestTriggerCount(int connectionHarvestTriggerCount) Deprecated.voidsetConnectionLabelingHighCost(int connectionLabelingHighCost) Deprecated.voidsetConnectionPoolName(String connectionPoolName) Deprecated.voidsetConnectionRepurposeThreshold(int connectionRepurposeThreshold) Deprecated.voidsetConnectionValidationTimeout(int connectionValidationTimeout) Deprecated.voidsetConnectionWaitTimeout(int connectionWaitTimeout) Deprecated.voidsetDatabaseName(String databaseName) Deprecated.voidsetDataSourceName(String dataSourceName) Deprecated.voidsetDescription(String description) Deprecated.voidsetFastConnectionFailoverEnabled(boolean fastConnectionFailoverEnabled) Deprecated.voidsetHighCostConnectionReuseThreshold(int highCostConnectionReuseThreshold) Deprecated.voidsetInactiveConnectionTimeout(int inactiveConnectionTimeout) Deprecated.voidsetInitialPoolSize(int initialPoolSize) Deprecated.voidsetLoginTimeout(int loginTimeout) Deprecated.voidsetLogWriter(PrintWriter out) Deprecated.voidsetMaxConnectionReuseCount(int maxConnectionReuseCount) Deprecated.voidsetMaxConnectionReuseTime(int maxConnectionReuseTime) Deprecated.voidsetMaxConnectionsPerShard(int maxConnectionsPerShard) Deprecated.voidsetMaxIdleTime(int maxIdleTime) Deprecated.voidsetMaxPoolSize(int maxPoolSize) Deprecated.voidsetMaxStatements(int maxStatements) Deprecated.voidsetMinIdle(int minIdle) Deprecated.voidsetMinPoolSize(int minPoolSize) Deprecated.voidsetNetworkProtocol(String networkProtocol) Deprecated.voidsetONSConfiguration(String onsConfiguration) Deprecated.voidsetPortNumber(int portNumber) Deprecated.voidsetPropertyCycle(int propertyCycle) Deprecated.voidsetRoleName(String roleName) Deprecated.voidsetSecondsToTrustIdleConnection(int secondsToTrustIdleConnection) Deprecated.voidsetServerName(String serverName) Deprecated.voidsetShardingMode(boolean shardingMode) Deprecated.voidsetSQLForValidateConnection(String sqlForValidateConnection) Deprecated.voidsetTimeoutCheckInterval(int timeoutCheckInterval) Deprecated.voidsetTimeToLiveConnectionTimeout(int timeToLiveConnectionTimeout) Deprecated.voidsetValidateConnectionOnBorrow(boolean validateConnectionOnBorrow) Deprecated.<T> TDeprecated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilderMethods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
Constructor Details
-
UCPDataSource
public UCPDataSource()Deprecated.
-
-
Method Details
-
datasource
Deprecated.Returns the datasource@Beanreference. This is picked-up automatically by other Spring beans, in particulary (JdbTemplate @Bean).- Returns:
- datasource @Bean reference.
-
getPoolDataSource
Deprecated.Returns the reference to the instantiatedPoolDataSource. After initialization, interaction with the pool is through this method.- Returns:
- poolDataSource reference.
-
afterPropertiesSet
public void afterPropertiesSet() throws SQLException, IllegalAccessException, IllegalArgumentException, InvocationTargetExceptionDeprecated.After the bean has all its properties injected, this method creates thePoolDataSourcedecorated instance.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
SQLExceptionIllegalAccessExceptionIllegalArgumentExceptionInvocationTargetException
-
setConnectionFactoryClassName
Deprecated. -
setServerName
Deprecated. -
setPortNumber
Deprecated. -
setDatabaseName
Deprecated. -
setDataSourceName
public void setDataSourceName(String dataSourceName) throws NoSuchMethodException, SecurityException Deprecated. -
setDescription
Deprecated. -
setNetworkProtocol
public void setNetworkProtocol(String networkProtocol) throws NoSuchMethodException, SecurityException Deprecated. -
setRoleName
Deprecated. -
setValidateConnectionOnBorrow
public void setValidateConnectionOnBorrow(boolean validateConnectionOnBorrow) throws NoSuchMethodException, SecurityException Deprecated. -
setSQLForValidateConnection
public void setSQLForValidateConnection(String sqlForValidateConnection) throws NoSuchMethodException, SecurityException Deprecated. -
setConnectionPoolName
public void setConnectionPoolName(String connectionPoolName) throws NoSuchMethodException, SecurityException Deprecated. -
setInitialPoolSize
Deprecated. -
setMinPoolSize
Deprecated. -
setMinIdle
Deprecated. -
setMaxPoolSize
Deprecated. -
setAbandonedConnectionTimeout
public void setAbandonedConnectionTimeout(int abandonedConnectionTimeout) throws NoSuchMethodException, SecurityException Deprecated. -
setTimeToLiveConnectionTimeout
public void setTimeToLiveConnectionTimeout(int timeToLiveConnectionTimeout) throws NoSuchMethodException, SecurityException Deprecated. -
setInactiveConnectionTimeout
public void setInactiveConnectionTimeout(int inactiveConnectionTimeout) throws NoSuchMethodException, SecurityException Deprecated. -
setMaxIdleTime
Deprecated. -
setTimeoutCheckInterval
public void setTimeoutCheckInterval(int timeoutCheckInterval) throws NoSuchMethodException, SecurityException Deprecated. -
setPropertyCycle
Deprecated. -
setMaxStatements
Deprecated. -
setConnectionWaitTimeout
public void setConnectionWaitTimeout(int connectionWaitTimeout) throws NoSuchMethodException, SecurityException Deprecated. -
setMaxConnectionReuseTime
public void setMaxConnectionReuseTime(int maxConnectionReuseTime) throws NoSuchMethodException, SecurityException Deprecated. -
setMaxConnectionReuseCount
public void setMaxConnectionReuseCount(int maxConnectionReuseCount) throws NoSuchMethodException, SecurityException Deprecated. -
setConnectionHarvestTriggerCount
public void setConnectionHarvestTriggerCount(int connectionHarvestTriggerCount) throws NoSuchMethodException, SecurityException Deprecated. -
setConnectionHarvestMaxCount
public void setConnectionHarvestMaxCount(int connectionHarvestMaxCount) throws NoSuchMethodException, SecurityException Deprecated. -
setFastConnectionFailoverEnabled
public void setFastConnectionFailoverEnabled(boolean fastConnectionFailoverEnabled) throws NoSuchMethodException, SecurityException Deprecated. -
setONSConfiguration
public void setONSConfiguration(String onsConfiguration) throws NoSuchMethodException, SecurityException Deprecated. -
setSecondsToTrustIdleConnection
public void setSecondsToTrustIdleConnection(int secondsToTrustIdleConnection) throws NoSuchMethodException, SecurityException Deprecated. -
setConnectionLabelingHighCost
public void setConnectionLabelingHighCost(int connectionLabelingHighCost) throws NoSuchMethodException, SecurityException Deprecated. -
setConnectionRepurposeThreshold
public void setConnectionRepurposeThreshold(int connectionRepurposeThreshold) throws NoSuchMethodException, SecurityException Deprecated. -
setHighCostConnectionReuseThreshold
public void setHighCostConnectionReuseThreshold(int highCostConnectionReuseThreshold) throws NoSuchMethodException, SecurityException Deprecated. -
setMaxConnectionsPerShard
public void setMaxConnectionsPerShard(int maxConnectionsPerShard) throws NoSuchMethodException, SecurityException Deprecated. -
setShardingMode
Deprecated. -
setConnectionValidationTimeout
public void setConnectionValidationTimeout(int connectionValidationTimeout) throws NoSuchMethodException, SecurityException Deprecated. -
getParentLogger
Deprecated.- Specified by:
getParentLoggerin interfaceCommonDataSource- Throws:
SQLFeatureNotSupportedException
-
unwrap
Deprecated.- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
isWrapperFor
Deprecated.- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
getConnection
Deprecated.- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getConnection
Deprecated.- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getLogWriter
Deprecated.- Specified by:
getLogWriterin interfaceCommonDataSource- Specified by:
getLogWriterin interfaceDataSource- Throws:
SQLException
-
setLogWriter
Deprecated.- Specified by:
setLogWriterin interfaceCommonDataSource- Specified by:
setLogWriterin interfaceDataSource- Throws:
SQLException
-
setLoginTimeout
Deprecated.- Specified by:
setLoginTimeoutin interfaceCommonDataSource- Specified by:
setLoginTimeoutin interfaceDataSource- Throws:
SQLException
-
getLoginTimeout
Deprecated.- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Specified by:
getLoginTimeoutin interfaceDataSource- Throws:
SQLException
-