Class UCPDataSource
- java.lang.Object
-
- oracle.ucp.jdbc.UCPDataSource
-
- All Implemented Interfaces:
java.sql.Wrapper,javax.sql.CommonDataSource,javax.sql.DataSource,org.springframework.beans.factory.InitializingBean
@Deprecated @Configuration @ConfigurationProperties("spring.datasource.ucp") public class UCPDataSource extends java.lang.Object implements javax.sql.DataSource, org.springframework.beans.factory.InitializingBeanDeprecated.This decorator of
PoolDataSourceallows 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.UCPDataSourceSpring 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.PoolDataSourceand rest of the ucp properties can be set similarly using 'spring.datasource.oracleucp' prefix
-
-
Constructor Summary
Constructors Constructor Description UCPDataSource()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidafterPropertiesSet()Deprecated.After the bean has all its properties injected, this method creates thePoolDataSourcedecorated instance.javax.sql.DataSourcedatasource()Deprecated.Returns the datasource@Beanreference.java.sql.ConnectiongetConnection()Deprecated.java.sql.ConnectiongetConnection(java.lang.String username, java.lang.String password)Deprecated.intgetLoginTimeout()Deprecated.java.io.PrintWritergetLogWriter()Deprecated.java.util.logging.LoggergetParentLogger()Deprecated.PoolDataSourcegetPoolDataSource()Deprecated.Returns the reference to the instantiatedPoolDataSource.booleanisWrapperFor(java.lang.Class<?> iface)Deprecated.voidsetAbandonedConnectionTimeout(int abandonedConnectionTimeout)Deprecated.voidsetConnectionFactoryClassName(java.lang.String connectionFactoryClassName)Deprecated.voidsetConnectionHarvestMaxCount(int connectionHarvestMaxCount)Deprecated.voidsetConnectionHarvestTriggerCount(int connectionHarvestTriggerCount)Deprecated.voidsetConnectionLabelingHighCost(int connectionLabelingHighCost)Deprecated.voidsetConnectionPoolName(java.lang.String connectionPoolName)Deprecated.voidsetConnectionRepurposeThreshold(int connectionRepurposeThreshold)Deprecated.voidsetConnectionValidationTimeout(int connectionValidationTimeout)Deprecated.voidsetConnectionWaitTimeout(int connectionWaitTimeout)Deprecated.voidsetDatabaseName(java.lang.String databaseName)Deprecated.voidsetDataSourceName(java.lang.String dataSourceName)Deprecated.voidsetDescription(java.lang.String description)Deprecated.voidsetFastConnectionFailoverEnabled(boolean fastConnectionFailoverEnabled)Deprecated.voidsetHighCostConnectionReuseThreshold(int highCostConnectionReuseThreshold)Deprecated.voidsetInactiveConnectionTimeout(int inactiveConnectionTimeout)Deprecated.voidsetInitialPoolSize(int initialPoolSize)Deprecated.voidsetLoginTimeout(int loginTimeout)Deprecated.voidsetLogWriter(java.io.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(java.lang.String networkProtocol)Deprecated.voidsetONSConfiguration(java.lang.String onsConfiguration)Deprecated.voidsetPortNumber(int portNumber)Deprecated.voidsetPropertyCycle(int propertyCycle)Deprecated.voidsetRoleName(java.lang.String roleName)Deprecated.voidsetSecondsToTrustIdleConnection(int secondsToTrustIdleConnection)Deprecated.voidsetServerName(java.lang.String serverName)Deprecated.voidsetShardingMode(boolean shardingMode)Deprecated.voidsetSQLForValidateConnection(java.lang.String sqlForValidateConnection)Deprecated.voidsetTimeoutCheckInterval(int timeoutCheckInterval)Deprecated.voidsetTimeToLiveConnectionTimeout(int timeToLiveConnectionTimeout)Deprecated.voidsetValidateConnectionOnBorrow(boolean validateConnectionOnBorrow)Deprecated.<T> Tunwrap(java.lang.Class<T> iface)Deprecated.
-
-
-
Method Detail
-
datasource
@Bean public javax.sql.DataSource datasource()
Deprecated.Returns the datasource@Beanreference. This is picked-up automatically by other Spring beans, in particulary (JdbTemplate @Bean).- Returns:
- datasource @Bean reference.
-
getPoolDataSource
public PoolDataSource 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 java.sql.SQLException, java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetExceptionDeprecated.After the bean has all its properties injected, this method creates thePoolDataSourcedecorated instance.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.sql.SQLExceptionjava.lang.IllegalAccessExceptionjava.lang.IllegalArgumentExceptionjava.lang.reflect.InvocationTargetException
-
setConnectionFactoryClassName
public void setConnectionFactoryClassName(java.lang.String connectionFactoryClassName)
Deprecated.
-
setServerName
public void setServerName(java.lang.String serverName) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setPortNumber
public void setPortNumber(int portNumber) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setDatabaseName
public void setDatabaseName(java.lang.String databaseName) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setDataSourceName
public void setDataSourceName(java.lang.String dataSourceName) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setDescription
public void setDescription(java.lang.String description) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setNetworkProtocol
public void setNetworkProtocol(java.lang.String networkProtocol) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setRoleName
public void setRoleName(java.lang.String roleName) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setValidateConnectionOnBorrow
public void setValidateConnectionOnBorrow(boolean validateConnectionOnBorrow) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setSQLForValidateConnection
public void setSQLForValidateConnection(java.lang.String sqlForValidateConnection) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setConnectionPoolName
public void setConnectionPoolName(java.lang.String connectionPoolName) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setInitialPoolSize
public void setInitialPoolSize(int initialPoolSize) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setMinPoolSize
public void setMinPoolSize(int minPoolSize) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setMinIdle
public void setMinIdle(int minIdle) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setMaxPoolSize
public void setMaxPoolSize(int maxPoolSize) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setAbandonedConnectionTimeout
public void setAbandonedConnectionTimeout(int abandonedConnectionTimeout) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setTimeToLiveConnectionTimeout
public void setTimeToLiveConnectionTimeout(int timeToLiveConnectionTimeout) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setInactiveConnectionTimeout
public void setInactiveConnectionTimeout(int inactiveConnectionTimeout) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setMaxIdleTime
public void setMaxIdleTime(int maxIdleTime) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setTimeoutCheckInterval
public void setTimeoutCheckInterval(int timeoutCheckInterval) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setPropertyCycle
public void setPropertyCycle(int propertyCycle) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setMaxStatements
public void setMaxStatements(int maxStatements) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setConnectionWaitTimeout
public void setConnectionWaitTimeout(int connectionWaitTimeout) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setMaxConnectionReuseTime
public void setMaxConnectionReuseTime(int maxConnectionReuseTime) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setMaxConnectionReuseCount
public void setMaxConnectionReuseCount(int maxConnectionReuseCount) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setConnectionHarvestTriggerCount
public void setConnectionHarvestTriggerCount(int connectionHarvestTriggerCount) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setConnectionHarvestMaxCount
public void setConnectionHarvestMaxCount(int connectionHarvestMaxCount) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setFastConnectionFailoverEnabled
public void setFastConnectionFailoverEnabled(boolean fastConnectionFailoverEnabled) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setONSConfiguration
public void setONSConfiguration(java.lang.String onsConfiguration) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setSecondsToTrustIdleConnection
public void setSecondsToTrustIdleConnection(int secondsToTrustIdleConnection) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setConnectionLabelingHighCost
public void setConnectionLabelingHighCost(int connectionLabelingHighCost) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setConnectionRepurposeThreshold
public void setConnectionRepurposeThreshold(int connectionRepurposeThreshold) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setHighCostConnectionReuseThreshold
public void setHighCostConnectionReuseThreshold(int highCostConnectionReuseThreshold) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setMaxConnectionsPerShard
public void setMaxConnectionsPerShard(int maxConnectionsPerShard) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setShardingMode
public void setShardingMode(boolean shardingMode) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
setConnectionValidationTimeout
public void setConnectionValidationTimeout(int connectionValidationTimeout) throws java.lang.NoSuchMethodException, java.lang.SecurityExceptionDeprecated.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
getParentLogger
public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedExceptionDeprecated.- Specified by:
getParentLoggerin interfacejavax.sql.CommonDataSource- Throws:
java.sql.SQLFeatureNotSupportedException
-
unwrap
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLExceptionDeprecated.- Specified by:
unwrapin interfacejava.sql.Wrapper- Throws:
java.sql.SQLException
-
isWrapperFor
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLExceptionDeprecated.- Specified by:
isWrapperForin interfacejava.sql.Wrapper- Throws:
java.sql.SQLException
-
getConnection
public java.sql.Connection getConnection() throws java.sql.SQLExceptionDeprecated.- Specified by:
getConnectionin interfacejavax.sql.DataSource- Throws:
java.sql.SQLException
-
getConnection
public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLExceptionDeprecated.- Specified by:
getConnectionin interfacejavax.sql.DataSource- Throws:
java.sql.SQLException
-
getLogWriter
public java.io.PrintWriter getLogWriter() throws java.sql.SQLExceptionDeprecated.- Specified by:
getLogWriterin interfacejavax.sql.CommonDataSource- Specified by:
getLogWriterin interfacejavax.sql.DataSource- Throws:
java.sql.SQLException
-
setLogWriter
public void setLogWriter(java.io.PrintWriter out) throws java.sql.SQLExceptionDeprecated.- Specified by:
setLogWriterin interfacejavax.sql.CommonDataSource- Specified by:
setLogWriterin interfacejavax.sql.DataSource- Throws:
java.sql.SQLException
-
setLoginTimeout
public void setLoginTimeout(int loginTimeout) throws java.sql.SQLExceptionDeprecated.- Specified by:
setLoginTimeoutin interfacejavax.sql.CommonDataSource- Specified by:
setLoginTimeoutin interfacejavax.sql.DataSource- Throws:
java.sql.SQLException
-
getLoginTimeout
public int getLoginTimeout() throws java.sql.SQLExceptionDeprecated.- Specified by:
getLoginTimeoutin interfacejavax.sql.CommonDataSource- Specified by:
getLoginTimeoutin interfacejavax.sql.DataSource- Throws:
java.sql.SQLException
-
-