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
b02073b4
Commit
b02073b4
authored
Jan 27, 2016
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
217f825d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
DataSourceAutoConfigurationTests.java
.../autoconfigure/jdbc/DataSourceAutoConfigurationTests.java
+2
-2
spring-boot-features.adoc
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
+4
-4
No files found.
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfigurationTests.java
View file @
b02073b4
/*
/*
* Copyright 2012-201
4
the original author or authors.
* Copyright 2012-201
6
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -85,7 +85,7 @@ public class DataSourceAutoConfigurationTests {
...
@@ -85,7 +85,7 @@ public class DataSourceAutoConfigurationTests {
}
}
@Test
@Test
public
void
testDataSource
Url
HasEmbeddedDefault
()
throws
Exception
{
public
void
testDataSourceHasEmbeddedDefault
()
throws
Exception
{
this
.
context
.
register
(
DataSourceAutoConfiguration
.
class
,
this
.
context
.
register
(
DataSourceAutoConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
);
PropertyPlaceholderAutoConfiguration
.
class
);
this
.
context
.
refresh
();
this
.
context
.
refresh
();
...
...
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
View file @
b02073b4
...
@@ -2268,6 +2268,10 @@ For example, typical POM dependencies would be:
...
@@ -2268,6 +2268,10 @@ For example, typical POM dependencies would be:
</dependency>
</dependency>
----
----
NOTE: You need a dependency on `spring-jdbc` for an embedded database to be
auto-configured. In this example it's pulled in transitively via
`spring-boot-starter-data-jpa`.
TIP: If, for whatever reason, you do configure the connection URL for an embedded
TIP: If, for whatever reason, you do configure the connection URL for an embedded
database, care should be taken to ensure that the database’s automatic shutdown is
database, care should be taken to ensure that the database’s automatic shutdown is
disabled. If you're using H2 you should use `DB_CLOSE_ON_EXIT=FALSE` to do so. If you're
disabled. If you're using H2 you should use `DB_CLOSE_ON_EXIT=FALSE` to do so. If you're
...
@@ -2275,10 +2279,6 @@ using HSQLDB, you should ensure that `shutdown=true` is not used. Disabling the
...
@@ -2275,10 +2279,6 @@ using HSQLDB, you should ensure that `shutdown=true` is not used. Disabling the
automatic shutdown allows Spring Boot to control when the database is closed, thereby
automatic shutdown allows Spring Boot to control when the database is closed, thereby
ensuring that it happens once access to the database is no longer needed.
ensuring that it happens once access to the database is no longer needed.
NOTE: You need a dependency on `spring-jdbc` for an embedded database to be
auto-configured. In this example it's pulled in transitively via
`spring-boot-starter-data-jpa`.
[[boot-features-connect-to-production-database]]
[[boot-features-connect-to-production-database]]
...
...
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