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
- duplicates
-
DBUTILS-117 Error handling possible getParameterMetaData() results
- Resolved