summaryrefslogtreecommitdiffstats
path: root/dblib
diff options
context:
space:
mode:
Diffstat (limited to 'dblib')
-rwxr-xr-xdblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java7
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 {