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

getParameterMetaData Exception

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5, 1.6
    • None
    • None
    • Windows, JDK6

    Description

      using ojdbc6.jar to connect to Oracle, we get "ORA-00942 table or view not exist" exception. after dive into dbutils code, we found the exception is throw from
      org.apache.commons.dbcp.DelegatingPreparedStatement.getParameterMetaData

      this is a oracle bug , but dbutils should ignore it and continue processing

      in the AbstractQueryRunner.java

      method : fillStatement

      if (!pmdKnownBroken) {
      pmd = stmt.getParameterMetaData();
      int stmtCount = pmd.getParameterCount();
      int paramsCount = params == null ? 0 : params.length;

      if (stmtCount != paramsCount)

      { throw new SQLException("Wrong number of parameters: expected " + stmtCount + ", was given " + paramsCount); }

      }

      the code should catch the exception and set pmdKnownBroken to true and continue

      another suggestion:
      can the AbstractQueryRunner provide a method to set pmdKnownBroken in addtion to constructor ?

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            dingli dingli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment