commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dfabul...@apache.org
Subject svn commit: r832257 - /commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java
Date Tue, 03 Nov 2009 01:46:43 GMT
Author: dfabulich
Date: Tue Nov  3 01:46:43 2009
New Revision: 832257

URL: http://svn.apache.org/viewvc?rev=832257&view=rev
Log:
[DBUTILS-58] QueryRunner: Allow to completly disable use of PreparedStatement#getParameterMetaData

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=832257&r1=832256&r2=832257&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 Tue
Nov  3 01:46:43 2009
@@ -171,10 +171,13 @@
             return;
         }
         
-        ParameterMetaData pmd = stmt.getParameterMetaData();
-        if (pmd.getParameterCount() < params.length) {
-            throw new SQLException("Too many parameters: expected "
-                    + pmd.getParameterCount() + ", was given " + params.length);
+        ParameterMetaData pmd = null;
+        if (!pmdKnownBroken) {
+        	pmd = stmt.getParameterMetaData();
+            if (pmd.getParameterCount() < params.length) {
+                throw new SQLException("Too many parameters: expected "
+                        + pmd.getParameterCount() + ", was given " + params.length);
+            }
         }
         for (int i = 0; i < params.length; i++) {
             if (params[i] != null) {



Mime
View raw message