[
https://issues.apache.org/jira/browse/DBUTILS-122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14246993#comment-14246993
]
Sebb edited comment on DBUTILS-122 at 12/15/14 6:45 PM:
--------------------------------------------------------
As noted, this is an Oracle bug.
It does not make sense for DBUTILS to allow for this, as it would potentially
mask other errors.
The proper solution is for Oracle to fix the bug.
A work-round is to create the class specifying that pmd is known to be broken.
was (Author: [email protected]):
As noted, this is an Oracle bug.
It does not make sense to
> getParameterMetaData Exception
> -------------------------------
>
> Key: DBUTILS-122
> URL: https://issues.apache.org/jira/browse/DBUTILS-122
> Project: Commons DbUtils
> Issue Type: Bug
> Affects Versions: 1.5, 1.6
> Environment: Windows, JDK6
> Reporter: dingli
>
> 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 ?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)