DR AAF CADI integration
[dmaap/datarouter.git] / datarouter-prov / src / main / java / org / onap / dmaap / datarouter / provisioning / utils / DB.java
index 3e2436f..8ca7118 100644 (file)
@@ -185,8 +185,8 @@ public class DB {
             connection = getConnection();\r
             Set<String> actualTables = getTableSet(connection);\r
             boolean initialize = false;\r
-            for (String table : expectedTables) {\r
-                initialize |= !actualTables.contains(table.toLowerCase());\r
+            for (String tableName : expectedTables) {\r
+                initialize |= !actualTables.contains(tableName);\r
             }\r
             if (initialize) {\r
                 intlogger.info("PROV9001: First time startup; The database is being initialized.");\r
@@ -211,13 +211,13 @@ public class DB {
      * @return the set of table names\r
      */\r
     private Set<String> getTableSet(Connection connection) {\r
-        Set<String> tables = new HashSet<String>();\r
+        Set<String> tables = new HashSet<>();\r
         try {\r
             DatabaseMetaData md = connection.getMetaData();\r
             ResultSet rs = md.getTables(null, null, "%", null);\r
             if (rs != null) {\r
                 while (rs.next()) {\r
-                    tables.add(rs.getString("TABLE_NAME"));\r
+                    tables.add(rs.getString("TABLE_NAME").toUpperCase());\r
                 }\r
                 rs.close();\r
             }\r