A new `spring.datasource.type` property can now be used to configure the
connection pool implementation to use (rather than only relying on Boot's
preferences).
Closes gh-3705
@ -40,6 +42,12 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
@@ -40,6 +42,12 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
@ -118,6 +126,14 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
@@ -118,6 +126,14 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
@ -144,6 +160,10 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
@@ -144,6 +160,10 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
@ -159,6 +179,10 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
@@ -159,6 +179,10 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
returnurl;
}
publicvoidsetUrl(Stringurl){
this.url=url;
}
publicStringgetUsername(){
if(StringUtils.hasText(this.username)){
returnthis.username;
@ -169,6 +193,10 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
@@ -169,6 +193,10 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
returnnull;
}
publicvoidsetUsername(Stringusername){
this.username=username;
}
publicStringgetPassword(){
if(StringUtils.hasText(this.password)){
returnthis.password;
@ -179,18 +207,6 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
@@ -179,18 +207,6 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
@ -318,6 +318,7 @@ content into your application; rather pick only the properties that you need.
@@ -318,6 +318,7 @@ content into your application; rather pick only the properties that you need.
spring.datasource.platform= # the platform to use in the schema resource (schema-${platform}.sql)
spring.datasource.continue-on-error=false # continue even if can't be initialized
spring.datasource.separator=; # statement separator in SQL initialization scripts
spring.datasource.type= # fully qualified name of the connection pool implementation to use
@ -2047,8 +2047,10 @@ Here's the algorithm for choosing a specific implementation:
@@ -2047,8 +2047,10 @@ Here's the algorithm for choosing a specific implementation:
If you use the `spring-boot-starter-jdbc` or `spring-boot-starter-data-jpa`
'`starter POMs`' you will automatically get a dependency to `tomcat-jdbc`.
NOTE: Additional connection pools can always be configured manually. If you define your
own `DataSource` bean, auto-configuration will not occur.
NOTE: You can bypass that algorithm completely and specify the connection pool to use via
the `spring.datasource.type` property. Also, additional connection pools can always be
configured manually. If you define your own `DataSource` bean, auto-configuration will
not occur.
DataSource configuration is controlled by external configuration properties in
`+spring.datasource.*+`. For example, you might declare the following section in