commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dutron (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DBUTILS-117) Error handling possible getParameterMetaData() results
Date Thu, 24 Nov 2016 17:03:58 GMT

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

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

I answer to myself :
*Question 1* : I find the try catch in the master but this catch only an exception of type
SQLFeatureNotSupportedException which is an answer to drivers well done but not bugged like
Oracle one.

*Question 3* :
In fact I did not see that the user could specify the pmdKnownBroken parameter in the constructor
of the AbstractQuerryRunner. With this parameter enabled, I think that we are working in the
mode where we are not dependent with the metadata provider. Until now, all is working but
it seems to be less secure with this parameter not enabled. The code impacted is the following
:
{code:java}
 // VARCHAR works with many drivers regardless
// of the actual column type. Oddly, NULL and
// OTHER don't work with Oracle's drivers.
int sqlType = Types.VARCHAR;
if (!pmdKnownBroken) {
    try {
        sqlType = pmd.getParameterType(i + 1);
    } catch (SQLException e) {
        pmdKnownBroken = true;
    }
}
stmt.setNull(i + 1, sqlType);
{code}

bq. //VARCHAR works with many drivers regardless of the actual column type. Oddly, NULL and
OTHER don't work with Oracle's drivers.

Not sur to well understand what's this mean...

> 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)

Mime
View raw message