Add a property to configure the connection pool

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
This commit is contained in:
Stephane Nicoll
2015-08-14 13:30:14 +02:00
parent e4b81b173c
commit 2d62e1fc89
5 changed files with 55 additions and 20 deletions

View File

@@ -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
spring.datasource.driver-class-name= # JDBC Settings...
spring.datasource.url=
spring.datasource.username=

View File

@@ -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