Class 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.InitializingBean
    Deprecated.

    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 23c, 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 Detail

      • UCPDataSource

        public UCPDataSource()
        Deprecated.
    • Method Detail

      • datasource

        @Bean
        public javax.sql.DataSource datasource()
        Deprecated.
        Returns the datasource @Bean reference. 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 instantiated PoolDataSource. 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.InvocationTargetException
        Deprecated.
        After the bean has all its properties injected, this method creates the PoolDataSource decorated instance.
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        java.sql.SQLException
        java.lang.IllegalAccessException
        java.lang.IllegalArgumentException
        java.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.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setPortNumber

        public void setPortNumber​(int portNumber)
                           throws java.lang.NoSuchMethodException,
                                  java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setDatabaseName

        public void setDatabaseName​(java.lang.String databaseName)
                             throws java.lang.NoSuchMethodException,
                                    java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setDataSourceName

        public void setDataSourceName​(java.lang.String dataSourceName)
                               throws java.lang.NoSuchMethodException,
                                      java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setDescription

        public void setDescription​(java.lang.String description)
                            throws java.lang.NoSuchMethodException,
                                   java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setNetworkProtocol

        public void setNetworkProtocol​(java.lang.String networkProtocol)
                                throws java.lang.NoSuchMethodException,
                                       java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setRoleName

        public void setRoleName​(java.lang.String roleName)
                         throws java.lang.NoSuchMethodException,
                                java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setValidateConnectionOnBorrow

        public void setValidateConnectionOnBorrow​(boolean validateConnectionOnBorrow)
                                           throws java.lang.NoSuchMethodException,
                                                  java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setSQLForValidateConnection

        public void setSQLForValidateConnection​(java.lang.String sqlForValidateConnection)
                                         throws java.lang.NoSuchMethodException,
                                                java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setConnectionPoolName

        public void setConnectionPoolName​(java.lang.String connectionPoolName)
                                   throws java.lang.NoSuchMethodException,
                                          java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setInitialPoolSize

        public void setInitialPoolSize​(int initialPoolSize)
                                throws java.lang.NoSuchMethodException,
                                       java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setMinPoolSize

        public void setMinPoolSize​(int minPoolSize)
                            throws java.lang.NoSuchMethodException,
                                   java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setMaxPoolSize

        public void setMaxPoolSize​(int maxPoolSize)
                            throws java.lang.NoSuchMethodException,
                                   java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setAbandonedConnectionTimeout

        public void setAbandonedConnectionTimeout​(int abandonedConnectionTimeout)
                                           throws java.lang.NoSuchMethodException,
                                                  java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setTimeToLiveConnectionTimeout

        public void setTimeToLiveConnectionTimeout​(int timeToLiveConnectionTimeout)
                                            throws java.lang.NoSuchMethodException,
                                                   java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setInactiveConnectionTimeout

        public void setInactiveConnectionTimeout​(int inactiveConnectionTimeout)
                                          throws java.lang.NoSuchMethodException,
                                                 java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setMaxIdleTime

        public void setMaxIdleTime​(int maxIdleTime)
                            throws java.lang.NoSuchMethodException,
                                   java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setTimeoutCheckInterval

        public void setTimeoutCheckInterval​(int timeoutCheckInterval)
                                     throws java.lang.NoSuchMethodException,
                                            java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setPropertyCycle

        public void setPropertyCycle​(int propertyCycle)
                              throws java.lang.NoSuchMethodException,
                                     java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setMaxStatements

        public void setMaxStatements​(int maxStatements)
                              throws java.lang.NoSuchMethodException,
                                     java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setConnectionWaitTimeout

        public void setConnectionWaitTimeout​(int connectionWaitTimeout)
                                      throws java.lang.NoSuchMethodException,
                                             java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setMaxConnectionReuseTime

        public void setMaxConnectionReuseTime​(int maxConnectionReuseTime)
                                       throws java.lang.NoSuchMethodException,
                                              java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setMaxConnectionReuseCount

        public void setMaxConnectionReuseCount​(int maxConnectionReuseCount)
                                        throws java.lang.NoSuchMethodException,
                                               java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setConnectionHarvestTriggerCount

        public void setConnectionHarvestTriggerCount​(int connectionHarvestTriggerCount)
                                              throws java.lang.NoSuchMethodException,
                                                     java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setConnectionHarvestMaxCount

        public void setConnectionHarvestMaxCount​(int connectionHarvestMaxCount)
                                          throws java.lang.NoSuchMethodException,
                                                 java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setFastConnectionFailoverEnabled

        public void setFastConnectionFailoverEnabled​(boolean fastConnectionFailoverEnabled)
                                              throws java.lang.NoSuchMethodException,
                                                     java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setONSConfiguration

        public void setONSConfiguration​(java.lang.String onsConfiguration)
                                 throws java.lang.NoSuchMethodException,
                                        java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setSecondsToTrustIdleConnection

        public void setSecondsToTrustIdleConnection​(int secondsToTrustIdleConnection)
                                             throws java.lang.NoSuchMethodException,
                                                    java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setConnectionLabelingHighCost

        public void setConnectionLabelingHighCost​(int connectionLabelingHighCost)
                                           throws java.lang.NoSuchMethodException,
                                                  java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setConnectionRepurposeThreshold

        public void setConnectionRepurposeThreshold​(int connectionRepurposeThreshold)
                                             throws java.lang.NoSuchMethodException,
                                                    java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setHighCostConnectionReuseThreshold

        public void setHighCostConnectionReuseThreshold​(int highCostConnectionReuseThreshold)
                                                 throws java.lang.NoSuchMethodException,
                                                        java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setMaxConnectionsPerShard

        public void setMaxConnectionsPerShard​(int maxConnectionsPerShard)
                                       throws java.lang.NoSuchMethodException,
                                              java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setShardingMode

        public void setShardingMode​(boolean shardingMode)
                             throws java.lang.NoSuchMethodException,
                                    java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • setConnectionValidationTimeout

        public void setConnectionValidationTimeout​(int connectionValidationTimeout)
                                            throws java.lang.NoSuchMethodException,
                                                   java.lang.SecurityException
        Deprecated.
        Throws:
        java.lang.NoSuchMethodException
        java.lang.SecurityException
      • getParentLogger

        public java.util.logging.Logger getParentLogger()
                                                 throws java.sql.SQLFeatureNotSupportedException
        Deprecated.
        Specified by:
        getParentLogger in interface javax.sql.CommonDataSource
        Throws:
        java.sql.SQLFeatureNotSupportedException
      • unwrap

        public <T> T unwrap​(java.lang.Class<T> iface)
                     throws java.sql.SQLException
        Deprecated.
        Specified by:
        unwrap in interface java.sql.Wrapper
        Throws:
        java.sql.SQLException
      • isWrapperFor

        public boolean isWrapperFor​(java.lang.Class<?> iface)
                             throws java.sql.SQLException
        Deprecated.
        Specified by:
        isWrapperFor in interface java.sql.Wrapper
        Throws:
        java.sql.SQLException
      • getConnection

        public java.sql.Connection getConnection()
                                          throws java.sql.SQLException
        Deprecated.
        Specified by:
        getConnection in interface javax.sql.DataSource
        Throws:
        java.sql.SQLException
      • getConnection

        public java.sql.Connection getConnection​(java.lang.String username,
                                                 java.lang.String password)
                                          throws java.sql.SQLException
        Deprecated.
        Specified by:
        getConnection in interface javax.sql.DataSource
        Throws:
        java.sql.SQLException
      • getLogWriter

        public java.io.PrintWriter getLogWriter()
                                         throws java.sql.SQLException
        Deprecated.
        Specified by:
        getLogWriter in interface javax.sql.CommonDataSource
        Specified by:
        getLogWriter in interface javax.sql.DataSource
        Throws:
        java.sql.SQLException
      • setLogWriter

        public void setLogWriter​(java.io.PrintWriter out)
                          throws java.sql.SQLException
        Deprecated.
        Specified by:
        setLogWriter in interface javax.sql.CommonDataSource
        Specified by:
        setLogWriter in interface javax.sql.DataSource
        Throws:
        java.sql.SQLException
      • setLoginTimeout

        public void setLoginTimeout​(int loginTimeout)
                             throws java.sql.SQLException
        Deprecated.
        Specified by:
        setLoginTimeout in interface javax.sql.CommonDataSource
        Specified by:
        setLoginTimeout in interface javax.sql.DataSource
        Throws:
        java.sql.SQLException
      • getLoginTimeout

        public int getLoginTimeout()
                            throws java.sql.SQLException
        Deprecated.
        Specified by:
        getLoginTimeout in interface javax.sql.CommonDataSource
        Specified by:
        getLoginTimeout in interface javax.sql.DataSource
        Throws:
        java.sql.SQLException