commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r1159512 - /commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java
Date Fri, 19 Aug 2011 06:19:57 GMT
Author: bayard
Date: Fri Aug 19 06:19:56 2011
New Revision: 1159512

URL: http://svn.apache.org/viewvc?rev=1159512&view=rev
Log:
Removing unnecessary connection closing. Switching update with boolean param method to private
per DBUTILS-78

Modified:
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java?rev=1159512&r1=1159511&r2=1159512&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java (original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java Fri
Aug 19 06:19:56 2011
@@ -121,8 +121,6 @@ public class QueryRunner extends Abstrac
      */
     private int[] batch(Connection conn, boolean closeConn, String sql, Object[][] params)
throws SQLException {
         if(conn == null) {
-            if(closeConn)
-                close(conn);
             throw new SQLException("Null connection");
         }
         
@@ -316,8 +314,6 @@ public class QueryRunner extends Abstrac
      */
     private <T> T query(Connection conn, boolean closeConn, String sql, ResultSetHandler<T>
rsh, Object... params) throws SQLException {
         if(conn == null) {
-            if(closeConn)
-                close(conn);
             throw new SQLException("Null connection");
         }
         
@@ -462,10 +458,8 @@ public class QueryRunner extends Abstrac
      * @return The number of rows updated.
      * @throws SQLException If there are database or parameter errors.
      */
-    public int update(Connection conn, boolean closeConn, String sql, Object... params) throws
SQLException {
+    private int update(Connection conn, boolean closeConn, String sql, Object... params)
throws SQLException {
         if(conn == null) {
-            if(closeConn)
-                close(conn);
             throw new SQLException("Null connection");
         }
         



Mime
View raw message