summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRam Koya <rk541m@att.com>2018-08-31 15:22:50 +0000
committerGerrit Code Review <gerrit@onap.org>2018-08-31 15:22:50 +0000
commit998071748faae0b0da58e6a50f8765fbd23b1969 (patch)
tree53547a916dcc1ee3df2f84e2535a9f9fa8b17aff
parent3429ec4ff1d54d1f477e835937b7ca16a7951740 (diff)
parentf435e534f7d4653ee3cdac429acbfeec314d7ba4 (diff)
Merge "Fixed Sonar Issues in NodeClass.java"
-rwxr-xr-xdatarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/NodeClass.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/NodeClass.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/NodeClass.java
index f3eb1eb6..1b368517 100755
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/NodeClass.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/NodeClass.java
@@ -105,13 +105,14 @@ public abstract class NodeClass extends Syncable {
public static void reload() {
Map<String, Integer> m = new HashMap<String, Integer>();
PreparedStatement ps = null;
+ ResultSet rs=null;
try {
DB db = new DB();
@SuppressWarnings("resource")
Connection conn = db.getConnection();
String sql = "select NODEID, NAME from NODES";
ps = conn.prepareStatement(sql);
- ResultSet rs = ps.executeQuery();
+ rs = ps.executeQuery();
while (rs.next()) {
int id = rs.getInt("NODEID");
String name = rs.getString("NAME");
@@ -127,6 +128,9 @@ public abstract class NodeClass extends Syncable {
if(ps!=null){
ps.close();
}
+ if(rs!=null){
+ rs.close();
+ }
} catch (SQLException e) {
intLogger.error("PROV0005 doInsert: " + e.getMessage(),e);