Polishing

See gh-22171
This commit is contained in:
Sébastien Deleuze
2024-03-07 18:16:57 +01:00
parent 34f0c27b5e
commit aa4282d7f8
2 changed files with 10 additions and 14 deletions

View File

@@ -9,13 +9,11 @@ class BasicDataSourceConfiguration {
// tag::dataSourceBean[] // tag::dataSourceBean[]
@Bean(destroyMethod = "close") @Bean(destroyMethod = "close")
fun dataSource(): BasicDataSource { fun dataSource() = BasicDataSource().apply {
val dataSource = BasicDataSource() driverClassName = "org.hsqldb.jdbcDriver"
dataSource.driverClassName = "org.hsqldb.jdbcDriver" url = "jdbc:hsqldb:hsql://localhost:"
dataSource.url = "jdbc:hsqldb:hsql://localhost:" username = "sa"
dataSource.username = "sa" password = ""
dataSource.password = ""
return dataSource
} }
// end::dataSourceBean[] // end::dataSourceBean[]
} }

View File

@@ -9,13 +9,11 @@ internal class ComboPooledDataSourceConfiguration {
// tag::dataSourceBean[] // tag::dataSourceBean[]
@Bean(destroyMethod = "close") @Bean(destroyMethod = "close")
fun dataSource(): ComboPooledDataSource { fun dataSource() = ComboPooledDataSource().apply {
val dataSource = ComboPooledDataSource() driverClass = "org.hsqldb.jdbcDriver"
dataSource.driverClass = "org.hsqldb.jdbcDriver" jdbcUrl = "jdbc:hsqldb:hsql://localhost:"
dataSource.jdbcUrl = "jdbc:hsqldb:hsql://localhost:" user = "sa"
dataSource.user = "sa" password = ""
dataSource.password = ""
return dataSource
} }
// end::dataSourceBean[] // end::dataSourceBean[]