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
+10-8Lines changed: 10 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -322,12 +322,13 @@ public void setUsername(String username) {
322
322
* @since 1.4.0
323
323
*/
324
324
publicStringdetermineUsername() {
325
-
if (EmbeddedDatabaseConnection.isEmbedded(determineDriverClassName()) && !StringUtils.hasText(determineUrl())) {
326
-
return"sa";
327
-
}
328
-
else {
325
+
if (StringUtils.hasText(this.username)) {
329
326
returnthis.username;
330
327
}
328
+
if (EmbeddedDatabaseConnection.isEmbedded(determineDriverClassName())) {
329
+
return"sa";
330
+
}
331
+
returnnull;
331
332
}
332
333
333
334
/**
@@ -349,12 +350,13 @@ public void setPassword(String password) {
349
350
* @since 1.4.0
350
351
*/
351
352
publicStringdeterminePassword() {
352
-
if (EmbeddedDatabaseConnection.isEmbedded(determineDriverClassName()) && !StringUtils.hasText(determineUrl())) {
353
-
return"";
354
-
}
355
-
else {
353
+
if (StringUtils.hasText(this.password)) {
356
354
returnthis.password;
357
355
}
356
+
if (EmbeddedDatabaseConnection.isEmbedded(determineDriverClassName())) {
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/TestDatabaseAutoConfiguration.java
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -80,6 +80,7 @@ private static class EmbeddedDataSourceBeanFactoryPostProcessor implements BeanD
0 commit comments