aboutsummaryrefslogtreecommitdiffstats
path: root/resource-assignment
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2019-05-29 20:23:15 +0000
committerGerrit Code Review <gerrit@onap.org>2019-05-29 20:23:15 +0000
commite49d1d1cd67a3ff3153520edf3a8fd5fc1439373 (patch)
treea02be2c95e9cea5a067b768d1032665089238cf7 /resource-assignment
parent54f8f8bab00517f2c535d45d6a481eb437654402 (diff)
parent4442cdefed7fd5852180efa203fbca7c41543527 (diff)
Merge "Revert "Fixed sonar fix in DataSourceWrap.java"" into dublin
Diffstat (limited to 'resource-assignment')
-rw-r--r--resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/db/DataSourceWrap.java26
1 files changed, 14 insertions, 12 deletions
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/db/DataSourceWrap.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/db/DataSourceWrap.java
index 259b9d8d..2aebb83e 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/db/DataSourceWrap.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/db/DataSourceWrap.java
@@ -4,7 +4,6 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
- * Modifications Copyright (C) 2018 IBM.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -75,22 +74,25 @@ public class DataSourceWrap implements DataSource {
@Override
public Connection getConnection() throws SQLException {
- try (Connection c = dataSource.getConnection()){
- log.debug("getConnection: " + c.getClass().getName());
- c.setAutoCommit(true);
- return c;
- }
+ Connection c = dataSource.getConnection();
+
+ log.debug("getConnection: " + c.getClass().getName());
+
+ c.setAutoCommit(true);
+ return c;
}
+
@Override
public Connection getConnection(String username, String password) throws SQLException {
- try (Connection c = dataSource.getConnection(username, password)){
- log.debug("getConnection: " + c.getClass().getName());
- c.setAutoCommit(true);
- return c;
- }
+ Connection c = dataSource.getConnection(username, password);
+
+ log.debug("getConnection: " + c.getClass().getName());
+
+ c.setAutoCommit(true);
+ return c;
}
- public void setDataSource(DataSource dataSource) {
+ public void setDataSource(DataSource dataSource) {
this.dataSource = dataSource;
}
}