aboutsummaryrefslogtreecommitdiffstats
path: root/sql-resource/provider/src/main
diff options
context:
space:
mode:
authorParshad Patel <pars.patel@samsung.com>2018-07-16 11:11:04 +0900
committerParshad Patel <pars.patel@samsung.com>2018-07-16 16:26:21 +0900
commitb84ab092b638b5babc0c9c4c3a11d39deb03c695 (patch)
tree268facead97bf9c07b166f5e9ee87d9d44a26ccc /sql-resource/provider/src/main
parent3c36ac2ba101ec0cc596c15bfd45efcc731f442f (diff)
Fix sonar issue in SqlResource.java
Add finally clause to close ResultSet Issue-ID: CCSDK-332 Change-Id: I1b856123caf56fad08064c63013cfe0859c2ae53 Signed-off-by: Parshad Patel <pars.patel@samsung.com>
Diffstat (limited to 'sql-resource/provider/src/main')
-rwxr-xr-xsql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java b/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java
index 1c0a0087..767fdac7 100755
--- a/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java
+++ b/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java
@@ -455,14 +455,15 @@ public class SqlResource implements SvcLogicResource, SvcLogicJavaPlugin {
LOG.warn("Cannot decrypt " + tableName + "." + colName);
}
} catch (Exception e) {
- if (results != null) {
+ LOG.error("Caught exception trying to decrypt " + tableName + "." + colName, e);
+ }finally {
+ if (results != null) {
try {
results.close();
- } catch (SQLException ignored) {
-
+ } catch (SQLException se) {
+ LOG.error("Caught exception trying to close ResultSet",se);
}
}
- LOG.error("Caught exception trying to decrypt " + tableName + "." + colName, e);
}
}
return (strValue);