Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

Commit

Permalink
Only generate DB config for Derby if no serverName specified
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Kurz <skurz@us.ibm.com>
  • Loading branch information
scottkurz committed Sep 13, 2019
1 parent 89324a0 commit 211b280
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,14 @@ public Properties getDatasourceProperties() {

// Verify correct property configuration
if (dependency.contains(DERBY_GROUP_ID)) {
if (!datasourceProperties.containsKey(BoostProperties.DATASOURCE_DATABASE_NAME)) {
// If there's no DB name and there's no server name then we can create an embedded DB at a default location
if ((!datasourceProperties.containsKey(BoostProperties.DATASOURCE_DATABASE_NAME)) &&
(!datasourceProperties.containsKey(BoostProperties.DATASOURCE_SERVER_NAME))) {
datasourceProperties.put(BoostProperties.DATASOURCE_DATABASE_NAME, DERBY_DB);
}
if (!datasourceProperties.containsKey(BoostProperties.DATASOURCE_CREATE_DATABASE)) {
datasourceProperties.put(BoostProperties.DATASOURCE_CREATE_DATABASE, "create");
// I guess if someone already specified something honor it, but we want to auto-create our default location DB
if (!datasourceProperties.containsKey(BoostProperties.DATASOURCE_CREATE_DATABASE)) {
datasourceProperties.put(BoostProperties.DATASOURCE_CREATE_DATABASE, "create");
}
}
} else {
// Check connection properties
Expand Down

0 comments on commit 211b280

Please sign in to comment.