commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julien Aymé (JIRA) <j...@apache.org>
Subject [jira] Commented: (DBUTILS-58) QueryRunner: Allow to completly disable use of PreparedStatement#getParameterMetaData
Date Fri, 21 Aug 2009 11:25:14 GMT

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

Julien Aymé commented on DBUTILS-58:
------------------------------------

The exception was thrown using msbase.jar, unknown version.
I was able to retrieve these information from com.microsoft.jdbc.base.BaseDriver.class using
jad:
{code}
    public final int getMajorVersion() {
        return 2;
    }

    public final int getMinorVersion() {
        return 2;
    }
{code}

> QueryRunner: Allow to completly disable use of PreparedStatement#getParameterMetaData
> -------------------------------------------------------------------------------------
>
>                 Key: DBUTILS-58
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-58
>             Project: Commons DbUtils
>          Issue Type: Improvement
>    Affects Versions: 1.2
>         Environment: MSSQL Server legacy jdbc driver
>            Reporter: Julien Aymé
>         Attachments: QueryRunner.diff, stacktrace.txt
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Some legacy JDBC driver does not support the PreparedStatement#getPreparedStatementMetaData()
method (see stacktrace in joined file).
> I would like to add an new boolean field (named disablePmd, set via constructors) to
QueryRunner, which would completly remove the use of this method in QueryRunner#fillStatement.
> {code}
>         ParameterMetaData pmd = null;
>         if (!disablePmd) {
>             pmd = stmt.getParameterMetaData();
>             if (pmd.getParameterCount() < params.length) {
>                 throw new SQLException("Too many parameters: expected "
>                         + pmd.getParameterCount() + ", was given " + params.length);
>             }
>         }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message