Uploaded image for project: 'Commons DbUtils'
  1. Commons DbUtils
  2. DBUTILS-58

QueryRunner: Allow to completly disable use of PreparedStatement#getParameterMetaData

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: 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);
                  }
              }
      

        Attachments

        1. stacktrace.txt
          0.7 kB
          Julien Aymé
        2. QueryRunner.diff
          4 kB
          Julien Aymé

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              julien.ayme@gmail.com 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