Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
Operating System: All
Platform: All
-
29393
Description
Index: QueryRunner.java
===================================================================
RCS file:
/home/cvspublic/jakarta-commons/dbutils/src/java/org/apache/commons/dbutils/QueryRunner.java,v
retrieving revision 1.10
diff -u -r1.10 QueryRunner.java
— QueryRunner.java 15 Mar 2004 05:31:40 -0000 1.10
+++ QueryRunner.java 4 Jun 2004 13:54:04 -0000
@@ -20,6 +20,7 @@
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
+import java.sql.Statement;
import java.sql.Types;
import java.util.Arrays;
@@ -86,7 +87,7 @@
} catch (SQLException e)
finally
{ - DbUtils.close(stmt); + close(stmt); }return rows;
@@ -111,7 +112,7 @@
try { return this.batch(conn, sql, params); } finally { - DbUtils.close(conn); + close(conn); }
}
@@ -222,9 +223,9 @@
} finally {
try { - DbUtils.close(rs); + close(rs); } finally { - DbUtils.close(stmt); + close(stmt); }
}
@@ -290,7 +291,7 @@
return this.query(conn, sql, params, rsh);
} finally {- DbUtils.close(conn);+ close(conn); }
}
@@ -410,7 +411,7 @@
this.rethrow(e, sql, params);
} finally {- DbUtils.close(stmt);+ close(stmt); }
return rows;
@@ -465,7 +466,7 @@
try
finally
{ - DbUtils.close(conn); + close(conn); }}
@@ -493,5 +494,25 @@
protected ResultSet wrap(ResultSet rs)
-
+
+ /**
+ * Close a <code>Connection</code>, avoid closing if null.
+ */
+ protected void close(Connection conn) throws SQLException
+
+ /**
+ * Close a <code>ResultSet</code>, avoid closing if null.
+ */
+ protected void close(ResultSet rs) throws SQLException
+
+ /**
+ * Close a <code>Statement</code>, avoid closing if null.
+ */
+ protected void close(Statement stmt) throws SQLException
}