Remove critical code smells for utils classes
[dmaap/datarouter.git] / datarouter-prov / src / main / java / org / onap / dmaap / datarouter / provisioning / utils / DB.java
index d29876f..7700a58 100644 (file)
@@ -84,7 +84,7 @@ public class DB {
                 HTTP_PORT = (String) props.get("org.onap.dmaap.datarouter.provserver.http.port");\r
                 Class.forName(DB_DRIVER);\r
             } catch (IOException e) {\r
-                intlogger.error("PROV9003 Opening properties: " + e.getMessage());\r
+                intlogger.error("PROV9003 Opening properties: " + e.getMessage(), e);\r
                 System.exit(1);\r
             } catch (ClassNotFoundException e) {\r
                 intlogger.error("PROV9004 cannot find the DB driver: " + e);\r
@@ -115,6 +115,7 @@ public class DB {
                 try {\r
                     connection = queue.remove();\r
                 } catch (NoSuchElementException nseEx) {\r
+                    intlogger.error("PROV9006 No connection on queue: " + nseEx.getMessage(), nseEx);\r
                     int n = 0;\r
                     do {\r
                         // Try up to 3 times to get a connection\r
@@ -194,8 +195,7 @@ public class DB {
                 runInitScript(connection, 1);\r
             }\r
         } catch (SQLException e) {\r
-            intlogger\r
-                .error("PROV9000: The database credentials are not working: " + e.getMessage());\r
+            intlogger.error("PROV9000: The database credentials are not working: " + e.getMessage(), e);\r
             return false;\r
         } finally {\r
             if (connection != null) {\r
@@ -223,7 +223,7 @@ public class DB {
                 rs.close();\r
             }\r
         } catch (SQLException e) {\r
-            intlogger.error("PROV9010: Failed to get TABLE data from DB: " + e.getMessage());\r
+            intlogger.error("PROV9010: Failed to get TABLE data from DB: " + e.getMessage(), e);\r
         }\r
         return tables;\r
     }\r
@@ -264,7 +264,7 @@ public class DB {
             lineReader.close();\r
             strBuilder.setLength(0);\r
         } catch (Exception e) {\r
-            intlogger.error("PROV9002 Error when initializing table: " + e.getMessage());\r
+            intlogger.error("PROV9002 Error when initializing table: " + e.getMessage(), e);\r
             System.exit(1);\r
         }\r
     }\r