Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
ea5195c8
Commit
ea5195c8
authored
Jan 21, 2016
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better document how DataSource is bound to the env
Closes gh-4971
parent
2dc3660a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
6 deletions
+24
-6
spring-boot-features.adoc
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
+24
-6
No files found.
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
View file @
ea5195c8
...
...
@@ -2315,19 +2315,37 @@ DataSource configuration is controlled by external configuration properties in
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
----
See {sc-spring-boot-autoconfigure}/jdbc/DataSourceProperties.{sc-ext}[`DataSourceProperties`]
for more of the supported options. Note also that you can configure any of the
`DataSource` implementation specific properties via `+spring.datasource.*+`: refer to the
documentation of the connection pool implementation you are using for more details.
TIP: You often won't need to specify the `driver-class-name` since Spring boot can deduce
it for most databases from the `url`.
NOTE: For a pooling `DataSource` to be created we need to be able to verify that a valid
`Driver` class is available, so we check for that before doing anything. I.e. if you set
`spring.datasource.driver
ClassN
ame=com.mysql.jdbc.Driver` then that class has to be
`spring.datasource.driver
-class-n
ame=com.mysql.jdbc.Driver` then that class has to be
loadable.
See {sc-spring-boot-autoconfigure}/jdbc/DataSourceProperties.{sc-ext}[`DataSourceProperties`]
for more of the supported options. These are the standard options that work regardless of
the actual implementation. It is also possible to fine tune implementation-specific settings
using the `+spring.datasource.*+` prefix, refer to the documentation of the connection pool
implementation you are using for more details.
For instance, if you are using the
http://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html#Common_Attributes[Tomcat connection pool]
you could customize many additional settings:
[source,properties,indent=0]
----
# Number of ms to wait before throwing an exception if no connection is available.
spring.datasource.max-wait=10000
# Maximum number of active connections that can be allocated from this pool at the same time.
spring.datasource.max-active=50
# Validate the connection before borrowing it from the pool.
spring.datasource.test-on-borrow=true
----
[[boot-features-connecting-to-a-jndi-datasource]]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment