-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Closed
Labels
status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply
Description
oracle.jdbc.pool.OracleDataSource and oracle.ucp.jdbc.PoolDataSourceImpl both have a 'dataSourceName` property.
It would be nice if this property was set by the DataSourceProperties name property. Similar to how you set the user property using the username property in #6027.
I configure my Oracle DataSource using this approach:
@Configuration
public class FooDataSourceConfig {
@Bean
@Primary
@ConfigurationProperties("app.datasource.foo")
public DataSourceProperties fooDataSourceProperties() {
return new DataSourceProperties();
}
@Bean
@Primary
@ConfigurationProperties("app.datasource.foo")
public DataSource fooDataSource() {
return fooDataSourceProperties().initializeDataSourceBuilder().build();
}
}with these application.properties:
app.datasource.foo.type=oracle.ucp.jdbc.PoolDataSourceImpl
app.datasource.foo.username=<username>
app.datasource.foo.password=<password>
app.datasource.foo.url=jdbc:oracle:thin:@//localhost:1521/servicename
app.datasource.foo.name=Foo
# Oracle UCP Specific Properties
app.datasource.foo.connectionFactoryClassName=oracle.jdbc.pool.OracleDataSource
app.datasource.foo.maxPoolSize=20
app.datasource.foo.minPoolSize=5
app.datasource.foo.maxIdleTime=5
app.datasource.foo.validateConnectionOnBorrow=true
app.datasource.foo.maxStatements=10
app.datasource.foo.fastConnectionFailoverEnabled=trueI expected the resulting DataSource @Bean to have its dataSourceName property set to "Foo".
Metadata
Metadata
Assignees
Labels
status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply