Detect embedded DBs when deducing driver class

Fix DataSourceProperties getUsername() and getPassword() methods to
call getDriverClassName() rather than using `this.driverClassName` to
ensure than deduced driver classes can be used.

Fixes gh-1421
pull/1487/merge
Phillip Webb 10 years ago
parent 5ef45c7494
commit d515595ca1

@ -118,7 +118,7 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
if (StringUtils.hasText(this.username)) {
return this.username;
}
if (EmbeddedDatabaseConnection.isEmbedded(this.driverClassName)) {
if (EmbeddedDatabaseConnection.isEmbedded(getDriverClassName())) {
return "sa";
}
return null;
@ -128,7 +128,7 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
if (StringUtils.hasText(this.password)) {
return this.password;
}
if (EmbeddedDatabaseConnection.isEmbedded(this.driverClassName)) {
if (EmbeddedDatabaseConnection.isEmbedded(getDriverClassName())) {
return "";
}
return null;

Loading…
Cancel
Save