Skip to content
Snippets Groups Projects
Commit e96bf48c authored by Nikolaus Krismer's avatar Nikolaus Krismer
Browse files

fixed findbugs problem

parent cee10c49
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ import com.tngtech.configbuilder.annotation.valueextractor.PropertyValue; ...@@ -10,6 +10,7 @@ import com.tngtech.configbuilder.annotation.valueextractor.PropertyValue;
import it.unibz.inf.isochrone.db.ConnectionFactory; import it.unibz.inf.isochrone.db.ConnectionFactory;
import java.sql.CallableStatement;
import java.sql.Connection; import java.sql.Connection;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
...@@ -183,8 +184,10 @@ public final class ConfigIsochrone { ...@@ -183,8 +184,10 @@ public final class ConfigIsochrone {
final String query = "SELECT tablename FROM pg_tables WHERE schemaname='public'"; final String query = "SELECT tablename FROM pg_tables WHERE schemaname='public'";
ResultSet rs = null; ResultSet rs = null;
CallableStatement stmt = null;
try { try {
rs = getConnection().prepareCall(query).executeQuery(); stmt = getConnection().prepareCall(query);
rs = stmt.executeQuery();
while (rs.next()) { while (rs.next()) {
result.add(rs.getString("tablename")); result.add(rs.getString("tablename"));
} }
...@@ -192,6 +195,7 @@ public final class ConfigIsochrone { ...@@ -192,6 +195,7 @@ public final class ConfigIsochrone {
LOGGER.warn("Could not get tables from database"); LOGGER.warn("Could not get tables from database");
} finally { } finally {
DbUtils.closeQuietly(rs); DbUtils.closeQuietly(rs);
DbUtils.closeQuietly(stmt);
} }
return result; return result;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment