Class UcpDataSourceConfig
java.lang.Object
com.maybeitssquid.rotatingsecrets.ucp.UcpDataSourceConfig
Spring configuration for Oracle Universal Connection Pool (UCP) DataSource.
This configuration creates an Oracle UCP PoolDataSource bean with configurable
connection pool settings. Oracle UCP is designed specifically for Oracle databases and
provides advanced features not available in generic connection pools.
Oracle UCP Advantages
- Fast Application Notification (FAN) - Automatic failover on RAC/Data Guard events
- Oracle Wallet Integration - Enterprise credential management
- Transparent Application Continuity - Automatic request replay on failover
- Service-Aware Connections - Different pools for different database services
Configuration Properties
All properties are prefixed with spring.datasource.ucp.:
url- JDBC URL for the Oracle database (required)connection-factory-class-name- JDBC driver class (required)user- Initial database username (required)password- Initial database password (required)pool-name- Connection pool name (default: UCPPool)initial-pool-size- Initial connections to create (default: 2)min-pool-size- Minimum pool size (default: 2)max-pool-size- Maximum pool size (default: 10)connection-wait-timeout- Seconds to wait for a connection (default: 20)inactive-connection-timeout- Seconds before idle connection is closed (default: 30)max-connection-reuse-time- Maximum seconds to reuse a connection (default: 1800)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionoracle.ucp.jdbc.PoolDataSourceCreates and configures the Oracle UCP PoolDataSource bean.ucpCredentialsUpdater(oracle.ucp.jdbc.PoolDataSource poolDataSource) Creates the UCP credentials updater bean for credential rotation support.
-
Constructor Details
-
UcpDataSourceConfig
public UcpDataSourceConfig()Default constructor.
-
-
Method Details
-
poolDataSource
Creates and configures the Oracle UCP PoolDataSource bean.The pool is configured with all connection and timeout settings from application properties. The returned
PoolDataSourcecan be used directly or wrapped for additional functionality.- Returns:
- a configured Oracle UCP PoolDataSource
- Throws:
SQLException- if the pool cannot be configured or initialized
-
ucpCredentialsUpdater
@Bean("ucpUpdater") public UcpCredentialsUpdater ucpCredentialsUpdater(oracle.ucp.jdbc.PoolDataSource poolDataSource) Creates the UCP credentials updater bean for credential rotation support.The updater is registered with the
CredentialsProviderServiceto receive notifications when database credentials are rotated. It handles updating the pool's credentials and refreshing connections.- Parameters:
poolDataSource- the Oracle UCP PoolDataSource to manage- Returns:
- a credentials updater configured for the given pool
- See Also:
-