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
This commit is contained in:
Phillip Webb 2014-08-21 22:06:01 -07:00
parent 5ef45c7494
commit d515595ca1
1 changed files with 2 additions and 2 deletions

View File

@ -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;