commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dfabul...@apache.org
Subject svn commit: r752523 - /commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java
Date Wed, 11 Mar 2009 16:55:49 GMT
Author: dfabulich
Date: Wed Mar 11 16:55:49 2009
New Revision: 752523

URL: http://svn.apache.org/viewvc?rev=752523&view=rev
Log:
DBUTILS-52, removing setDataSource method and making DataSource final

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=752523&r1=752522&r2=752523&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 Wed
Mar 11 16:55:49 2009
@@ -48,13 +48,14 @@
     /**
      * The DataSource to retrieve connections from.
      */
-    protected DataSource ds = null;
+    protected final DataSource ds;
 
     /**
      * Constructor for QueryRunner.
      */
     public QueryRunner() {
         super();
+        ds = null;
     }
 
     /**
@@ -66,6 +67,7 @@
     public QueryRunner(boolean pmdKnownBroken) {
         super();
         this.pmdKnownBroken = pmdKnownBroken; 
+        ds = null;
     }
     
     /**
@@ -77,7 +79,7 @@
      */
     public QueryRunner(DataSource ds) {
         super();
-        setDataSource(ds);
+        this.ds = ds;
     }
     
     /**
@@ -93,7 +95,7 @@
     public QueryRunner(DataSource ds, boolean pmdKnownBroken) {
         super();
         this.pmdKnownBroken = pmdKnownBroken;
-        setDataSource(ds);
+        this.ds = ds;
     }
     
     /**
@@ -543,18 +545,6 @@
     }
 
     /**
-     * Sets the <code>DataSource</code> this runner will use to get
-     * database connections from.  This should be called after creating a
-     * runner with the default constructor if you intend to use the
-     * execute methods without passing in a <code>Connection</code>.
-     * 
-     * @param dataSource The DataSource to use.
-     */
-    public void setDataSource(DataSource dataSource) {
-        this.ds = dataSource;
-    }
-
-    /**
      * Execute an SQL INSERT, UPDATE, or DELETE query without replacement
      * parameters.
      * 



Mime
View raw message