diff options
Diffstat (limited to 'common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/impl')
-rw-r--r-- | common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/impl/ConfigurationDataSource.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/impl/ConfigurationDataSource.java b/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/impl/ConfigurationDataSource.java index edbae2fa9c..0cfc96bc7f 100644 --- a/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/impl/ConfigurationDataSource.java +++ b/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/impl/ConfigurationDataSource.java @@ -2,6 +2,7 @@ package org.openecomp.config.impl; import org.apache.commons.configuration2.ImmutableConfiguration; import org.apache.commons.dbcp2.BasicDataSource; +import org.apache.commons.lang3.StringUtils; import org.openecomp.config.ConfigurationUtils; import org.openecomp.config.Constants; @@ -52,6 +53,9 @@ public final class ConfigurationDataSource { public static BasicDataSource initDataSource() throws Exception { ImmutableConfiguration dbConfig = ConfigurationRepository.lookup() .getConfigurationFor(Constants.DEFAULT_TENANT, Constants.DB_NAMESPACE); + if (StringUtils.isEmpty(dbConfig.getString("dbhost"))) { + return null; + } BasicDataSource datasource = new BasicDataSource(); String driverClassName = dbConfig.getString("driverClassName"); String jdbcUrl = dbConfig.getString("jdbcURL"); |