[libpostgresql-jdbc-java] 49/93: Don't ignore the result of Statement.executeQuery().
Emmanuel Bourg
ebourg-guest at moszumanska.debian.org
Mon Jan 9 10:18:51 UTC 2017
This is an automated email from the git hooks/post-receive script.
ebourg-guest pushed a commit to annotated tag REL9_3_1102
in repository libpostgresql-jdbc-java.
commit 6f0d85a58da55f50fcffc3d984fd0e97be7172f9
Author: Heikki Linnakangas <heikki.linnakangas at iki.fi>
Date: Wed Nov 13 21:20:48 2013 +0200
Don't ignore the result of Statement.executeQuery().
Coverity thinks it's bad form.
---
org/postgresql/jdbc4/AbstractJdbc4Connection.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/org/postgresql/jdbc4/AbstractJdbc4Connection.java b/org/postgresql/jdbc4/AbstractJdbc4Connection.java
index 817e457..3d7b0a5 100644
--- a/org/postgresql/jdbc4/AbstractJdbc4Connection.java
+++ b/org/postgresql/jdbc4/AbstractJdbc4Connection.java
@@ -121,12 +121,14 @@ abstract class AbstractJdbc4Connection extends org.postgresql.jdbc3g.AbstractJdb
throw new PSQLException(GT.tr("Invalid timeout ({0}<0).", timeout), PSQLState.INVALID_PARAMETER_VALUE);
}
boolean valid = false;
- Statement stmt = null;
+ Statement stmt = null;
+ ResultSet rs;
try {
if (!isClosed()) {
stmt = createStatement();
stmt.setQueryTimeout( timeout );
- stmt.executeQuery( "SELECT 1" );
+ rs = stmt.executeQuery( "SELECT 1" );
+ rs.close();
valid = true;
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git
More information about the pkg-java-commits
mailing list