diff options
author | Parshad Patel <pars.patel@samsung.com> | 2018-07-24 19:15:27 +0900 |
---|---|---|
committer | Parshad Patel <pars.patel@samsung.com> | 2018-07-25 10:28:50 +0900 |
commit | 47099b56dcecba622e574b37c0167a061d6f667b (patch) | |
tree | fe2cc455332142d03ec1c2fcdb021b5df5d9788c /dblib/provider/src | |
parent | cfabda23cb6dc6c98e3266228f3bd2f409591a2f (diff) |
Fix sonar issues
Fix sonar issues in ccsdk/sli/core
Issue-ID: CCSDK-332
Change-Id: I2aee69cf410d8f9cb63f3a22aeb793a99e27d2c7
Signed-off-by: Parshad Patel <pars.patel@samsung.com>
Diffstat (limited to 'dblib/provider/src')
-rwxr-xr-x | dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java index 97380f58..f3ecfa27 100755 --- a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java +++ b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java @@ -214,10 +214,8 @@ public abstract class CachedDataSource implements DataSource, SQLExecutionMonito throws SQLException { long time = System.currentTimeMillis(); - CachedRowSet data; - - try (PreparedStatement ps = conn.prepareStatement(statement)) { - data = RowSetProvider.newFactory().createCachedRowSet(); + try (PreparedStatement ps = conn.prepareStatement(statement); + CachedRowSet data = RowSetProvider.newFactory().createCachedRowSet()) { if (arguments != null) { prepareStatementForExecuteUpdate(arguments, ps); } @@ -227,7 +225,6 @@ public abstract class CachedDataSource implements DataSource, SQLExecutionMonito LOGGER.debug("SQL SUCCESS. rows returned: {}, time(ms): {}", data.size(), (System.currentTimeMillis() - time)); } - ps.close(); } catch (SQLException exc) { handleSqlExceptionForExecuteStatement(conn, statement, arguments, exc, time); } finally { |