diff options
-rw-r--r-- | UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/VESAdapterInitializer.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/VESAdapterInitializer.java b/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/VESAdapterInitializer.java index ca1bcc9..b63eb1e 100644 --- a/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/VESAdapterInitializer.java +++ b/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/VESAdapterInitializer.java @@ -147,10 +147,9 @@ public class VESAdapterInitializer implements CommandLineRunner, Ordered { } public void fetchMappingFile() { - try (Connection con = DriverManager.getConnection(dBurl, user, pwd)) { + String query = "SELECT * FROM mapping_file"; + try (Connection con = DriverManager.getConnection(dBurl, user, pwd);PreparedStatement pstmt = con.prepareStatement(query);ResultSet rs = pstmt.executeQuery();) { LOGGER.info("Retrieving data from DB"); - PreparedStatement pstmt = con.prepareStatement("SELECT * FROM mapping_file"); - ResultSet rs = pstmt.executeQuery(); // parsing the column each time is a linear search int column1Pos = rs.findColumn("enterpriseid"); int column2Pos = rs.findColumn("mappingfilecontents"); |