Commons DbUtils
  1. Commons DbUtils
  2. DBUTILS-58

QueryRunner: Allow to completly disable use of PreparedStatement#getParameterMetaData

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.3
    • Labels:
      None
    • Environment:

      MSSQL Server legacy jdbc driver

      Description

      Some legacy JDBC driver does not support the PreparedStatement#getPreparedStatementMetaData() method (see stacktrace in joined file).
      I would like to add an new boolean field (named disablePmd, set via constructors) to QueryRunner, which would completly remove the use of this method in QueryRunner#fillStatement.

              ParameterMetaData pmd = null;
              if (!disablePmd) {
                  pmd = stmt.getParameterMetaData();
                  if (pmd.getParameterCount() < params.length) {
                      throw new SQLException("Too many parameters: expected "
                              + pmd.getParameterCount() + ", was given " + params.length);
                  }
              }
      
      1. QueryRunner.diff
        4 kB
        Julien Aymé
      2. stacktrace.txt
        0.7 kB
        Julien Aymé

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Julien Aymé
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 2h
              2h
              Remaining:
              Remaining Estimate - 2h
              2h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development