Browse Source

Fix datasource example

pull/5025/merge
Stephane Nicoll 9 years ago
parent
commit
800ec29f70
  1. 6
      spring-boot-docs/src/main/asciidoc/howto.adoc
  2. 2
      spring-boot-docs/src/test/java/org/springframework/boot/jdbc/BasicDataSourceExampleTests.java

6
spring-boot-docs/src/main/asciidoc/howto.adoc

@ -1526,9 +1526,9 @@ is going to be used at runtime for more details. @@ -1526,9 +1526,9 @@ is going to be used at runtime for more details.
There is a catch however. Because the actual type of the connection pool is not exposed,
no keys are generated in the metadata for your custom `DataSource` and no completion is
available in your IDE (The `DataSource` interface doesn't expose any property). Also, if
you happen to _only_ have Hikari on the classpath, this basic setup will not work because
Hikari has no `url` parameter (but a `jdbcUrl` parameter). You will have to rewrite
your configuration as follows:
you happen to have Hikari on the classpath, this basic setup will not work because Hikari
has no `url` parameter (but a `jdbcUrl` parameter). You will have to rewrite your
configuration as follows:
[source,properties,indent=0]
----

2
spring-boot-docs/src/test/java/org/springframework/boot/jdbc/BasicDataSourceExampleTests.java

@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Stephane Nicoll
*/
@RunWith(SpringRunner.class)
@SpringBootTest(properties = "app.datasource.url=jdbc:h2:mem:basic;DB_CLOSE_DELAY=-1")
@SpringBootTest(properties = "app.datasource.jdbcUrl=jdbc:h2:mem:basic;DB_CLOSE_DELAY=-1")
@Import(BasicDataSourceExample.BasicDataSourceConfiguration.class)
public class BasicDataSourceExampleTests {

Loading…
Cancel
Save