You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Dutron (JIRA)" <ji...@apache.org> on 2016/11/24 10:48:59 UTC

[jira] [Commented] (DBUTILS-117) Error handling possible getParameterMetaData() results

    [ https://issues.apache.org/jira/browse/DBUTILS-117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15692949#comment-15692949 ] 

Dutron commented on DBUTILS-117:
--------------------------------

I have the same type of problem with getParameterMetaData method on oracle7.jar release 12.1.0.2 and DbUtil release 1.6.

I have a table with a "f" inside and Oracle does not like this and my dba does not want to change the table name...

There is an Oracle bug open for this bug (number 19583576) but it should only be corrected in the 12.2 release. Indeed if I do this : 

{noformat}
java -classpath ./ojdbc7-12.1.0.2.jar oracle.jdbc.driver.OracleParameterMetaDataParser "SELECT   PRU_PER_ID , PRU_PRF_ID  FROM sys_profil_users where pru_tts_created_by = :param0_String and pru_tts_updated_by = :param1_String"
SQL:SELECT   PRU_PER_ID , PRU_PRF_ID  FROM sys_profil_users where pru_tts_created_by = :param0_String and pru_tts_updated_by = :param1_String
  SqlKind:SELECT, Parameter Count=2
  Parameter SQL: SELECT pru_tts_updated_by FROM sys_prof
{noformat}

We can see that the table name is limited to "sys_prof" !

When I use DbUtil, this generate me a "ORA-00942: table or view does not exist" error when calling the getParameterMetaData method.

When I check the code of my 1.6 release of DbUtil I do not have the try catch. I use the pom :

{code:xml}
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/commons/proper/dbutils/tags/DBUTILS_1_6</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/commons/proper/dbutils/tags/DBUTILS_1_6</developerConnection>
<url>http://svn.apache.org/viewvc/commons/proper/dbutils/tags/DBUTILS_1_6</url>
</scm>
 {code}

If I look into the magnifest of the jar file :
{code}
Manifest-Version: 1.0
Export-Package: org.apache.commons.dbutils;version="1.6",org.apache.co
 mmons.dbutils.handlers;version="1.6",org.apache.commons.dbutils.wrapp
 ers;version="1.6"
Implementation-Title: Apache Commons DbUtils
Built-By: britter
Tool: Bnd-2.1.0.20130426-122213
Implementation-Vendor: The Apache Software Foundation
Implementation-Vendor-Id: org.apache
Specification-Title: Apache Commons DbUtils
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-SymbolicName: org.apache.commons.dbutils
X-Compile-Target-JDK: 1.6
Implementation-Version: 1.6
Specification-Vendor: The Apache Software Foundation
Bundle-Name: Apache Commons DbUtils
Created-By: Apache Maven Bundle Plugin
X-Compile-Source-JDK: 1.6
Bundle-Vendor: The Apache Software Foundation
Build-Jdk: 1.7.0_60
Bundle-Version: 1.6.0
Bnd-LastModified: 1405538584171
Bundle-ManifestVersion: 2
Bundle-Description: The Apache Commons DbUtils package is a set of  Ja
 va utility classes for easing JDBC development.
Bundle-DocURL: http://commons.apache.org/proper/commons-dbutils/
Import-Package: javax.sql
Include-Resource: META-INF/LICENSE.txt=LICENSE.txt,META-INF/NOTICE.txt
 =NOTICE.txt
Specification-Version: 1.6
Implementation-Build: UNKNOWN_BRANCH@r??????; 2014-07-16 19:23:00+0000
Archiver-Version: Plexus Archiver
{code}

So, my first question : what should I do in order to have the version with the try catch ?

--- 

Maybe the junit tests of dbUtil are made on a list of database drivers. I mean, some tests against the oracle7 12.1.0.2 driver should says "Do not go" 

So my secound question : are there somewhere tests like this ? Or do you mock the driver implementation ?

---
I saw that there is two others releases in the pipe, 1.7 and 2.0 and I saw nowhere else some db framework block by these oracle driver metadata problems. 

Last question : Do you plan to publish them in the near future and does these releases are still dependant of the metadata provided by the driver ?

Sorry to have been so long, regards
Fabrice



> Error handling possible getParameterMetaData() results
> ------------------------------------------------------
>
>                 Key: DBUTILS-117
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-117
>             Project: Commons DbUtils
>          Issue Type: Bug
>    Affects Versions: 1.5
>            Reporter: Vadim Smirnov
>            Priority: Minor
>              Labels: easyfix, newbie
>             Fix For: 1.6
>
>         Attachments: DBUTILS-117-tests.patch, DBUTILS-117.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Error in fillStatement method of AbstractQueryRunner class.
> There is no try...catch statement near pmd = stmt.getParameterMetaData();
> So method fails instead of automaticallye turning pmdKnownBroken to true.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)