commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1171932 - /commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/AbstractQueryRunner.java
Date Sat, 17 Sep 2011 09:44:01 GMT
Author: simonetripodi
Date: Sat Sep 17 09:44:01 2011
New Revision: 1171932

URL: http://svn.apache.org/viewvc?rev=1171932&view=rev
Log:
variables pmdKnownBroken and ds can be safetly make as private (not directly referenced in
subclasses)
added pmdKnownBroken getter to check the status it was set

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

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/AbstractQueryRunner.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/AbstractQueryRunner.java?rev=1171932&r1=1171931&r2=1171932&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/AbstractQueryRunner.java
(original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/AbstractQueryRunner.java
Sat Sep 17 09:44:01 2011
@@ -40,12 +40,12 @@ public abstract class AbstractQueryRunne
     /**
      * Is {@link ParameterMetaData#getParameterType(int)} broken (have we tried it yet)?
      */
-    protected volatile boolean pmdKnownBroken = false;
+    private volatile boolean pmdKnownBroken = false;
 
     /**
      * The DataSource to retrieve connections from.
      */
-    protected final DataSource ds;
+    private final DataSource ds;
 
     /**
      * Default constructor, sets pmdKnownBroken to false and ds to null.
@@ -103,6 +103,17 @@ public abstract class AbstractQueryRunne
         return this.ds;
     }
 
+    /**
+     * Oracle drivers don't support {@link ParameterMetaData#getParameterType(int) };
+     * if <code>pmdKnownBroken</code> is set to true, we won't even try it; if
false, we'll try it,
+     * and if it breaks, we'll remember not to use it again.
+     *
+     * @return the flag to skip (or not) {@link ParameterMetaData#getParameterType(int) }
+     * @since 1.4
+     */
+    public boolean isPmdKnownBroken() {
+        return pmdKnownBroken;
+    }
 
     /**
      * Factory method that creates and initializes a



Mime
View raw message