diff options
author | 2018-10-26 13:45:16 +0900 | |
---|---|---|
committer | 2018-10-26 13:56:14 +0900 | |
commit | 4f9b555bf0671cdfe1764ea2801b1251b473ae73 (patch) | |
tree | d81e050587da688a18f3ae98850ade1688f9a555 /UniversalVesAdapter | |
parent | 5ac0bcd19f06b601c2e913bf83a7359e7135fddb (diff) |
Fix sonar issue: try with resources
Issue-ID: DCAEGEN2-818
Change-Id: I419e7db32e39dc4a52a3d33b074b0a289a66ab21
Signed-off-by: arindamm <arind.mondal@samsung.com>
Diffstat (limited to 'UniversalVesAdapter')
-rw-r--r-- | UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/VESAdapterInitializer.java | 4 |
1 files changed, 1 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 a91e5c6..c195117 100644 --- a/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/VESAdapterInitializer.java +++ b/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/VESAdapterInitializer.java @@ -174,10 +174,8 @@ public class VESAdapterInitializer implements CommandLineRunner, Ordered { public void fetchMappingFile() { - try (Connection con = DriverManager.getConnection(dBurl, user, pwd)) { + try (Connection con = DriverManager.getConnection(dBurl, user, pwd);PreparedStatement pstmt = con.prepareStatement("SELECT * FROM mapping_file");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"); |