You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceProperties.java
+2-2
Original file line number
Diff line number
Diff line change
@@ -325,7 +325,7 @@ public String determineUsername() {
325
325
if (StringUtils.hasText(this.username)) {
326
326
returnthis.username;
327
327
}
328
-
if (EmbeddedDatabaseConnection.isEmbedded(determineDriverClassName(), determineUrl())) {
328
+
if (EmbeddedDatabaseConnection.isEmbedded(determineDriverClassName())) {
329
329
return"sa";
330
330
}
331
331
returnnull;
@@ -353,7 +353,7 @@ public String determinePassword() {
353
353
if (StringUtils.hasText(this.password)) {
354
354
returnthis.password;
355
355
}
356
-
if (EmbeddedDatabaseConnection.isEmbedded(determineDriverClassName(), determineUrl())) {
356
+
if (EmbeddedDatabaseConnection.isEmbedded(determineDriverClassName())) {
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourcePropertiesTests.java
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc
+2-2
Original file line number
Diff line number
Diff line change
@@ -1927,8 +1927,8 @@ This is controlled through two external properties:
1927
1927
You can set `spring.jpa.hibernate.ddl-auto` explicitly and the standard Hibernate property values are `none`, `validate`, `update`, `create`, and `create-drop`.
1928
1928
Spring Boot chooses a default value for you based on whether it thinks your database is embedded.
1929
1929
It defaults to `create-drop` if no schema manager has been detected or `none` in all other cases.
1930
-
An embedded database is detected by looking at the `Connection` type and JDBC url.
1931
-
`hsqldb`, `h2`, and `derby` are candidates, and others are not.
1930
+
An embedded database is detected by looking at the `Connection` type.
1931
+
`hsqldb`, `h2`, and `derby` are embedded, and others are not.
1932
1932
Be careful when switching from in-memory to a '`real`' database that you do not make assumptions about the existence of the tables and data in the new platform.
1933
1933
You either have to set `ddl-auto` explicitly or use one of the other mechanisms to initialize the database.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/EmbeddedDatabaseConnection.java
+13-53
Original file line number
Diff line number
Diff line change
@@ -17,11 +17,8 @@
17
17
packageorg.springframework.boot.jdbc;
18
18
19
19
importjava.sql.Connection;
20
-
importjava.sql.DatabaseMetaData;
21
20
importjava.sql.SQLException;
22
21
importjava.util.Locale;
23
-
importjava.util.function.Predicate;
24
-
importjava.util.stream.Stream;
25
22
26
23
importjavax.sql.DataSource;
27
24
@@ -46,25 +43,24 @@ public enum EmbeddedDatabaseConnection {
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/EmbeddedDatabaseConnectionTests.java
0 commit comments