Fixed Sonar issue in BaseDBConfiguration.java
authorezhil <ezhrajam@in.ibm.com>
Fri, 30 Nov 2018 11:32:27 +0000 (17:02 +0530)
committerezhil <ezhrajam@in.ibm.com>
Fri, 30 Nov 2018 11:32:39 +0000 (17:02 +0530)
Logged exception in Logger
Issue-ID: CCSDK-774
Change-Id: I28d10215daafd9f0dcaf7e0d765afbe72c184053
Signed-off-by: ezhil <ezhrajam@in.ibm.com>
dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/config/BaseDBConfiguration.java

index a8bc58b..5f0209b 100755 (executable)
@@ -3,6 +3,7 @@
  * onap
  * ================================================================================
  * Copyright (C) 2016 - 2017 ONAP
+ * Modifications Copyright (C) 2018 IBM.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.ccsdk.sli.core.dblib.config;
 
 import java.util.Properties;
-
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 /**
  * Base class responsible for parsing business logic for database configuration from given <code>Properties</code>.
  */
 public abstract class BaseDBConfiguration {
 
+    private Logger logger = LoggerFactory.getLogger(BaseDBConfiguration.class);
     /**
      * Property key within a properties configuration File for db type
      */
@@ -45,7 +48,7 @@ public abstract class BaseDBConfiguration {
     /**
      * Property key with a properties configuration File for jdbc driver
      */
-     public static final String DRIVER_NAME = "org.onap.ccsdk.sli.jdbc.driver";
+    public static final String DRIVER_NAME = "org.onap.ccsdk.sli.jdbc.driver";
 
     /**
      * Property key with a properties configuration File for db database connection name
@@ -131,6 +134,7 @@ public abstract class BaseDBConfiguration {
             String value = properties.getProperty(CONNECTION_TIMEOUT, DEFAULT_REJECT_CHANGE_VALUE);
             return Integer.parseInt(value);
         } catch (Exception exc) {
+            logger.error("Exception",exc);
             return Integer.parseInt(DEFAULT_REJECT_CHANGE_VALUE);
         }
     }
@@ -146,6 +150,7 @@ public abstract class BaseDBConfiguration {
             String value = properties.getProperty(REQUEST_TIMEOUT, DEFAULT_REJECT_CHANGE_VALUE);
             return Integer.parseInt(value);
         } catch (Exception exc) {
+            logger.error("Exception",exc);
             return Integer.parseInt(DEFAULT_REJECT_CHANGE_VALUE);
         }
     }