commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DBUTILS-117) Error in control the use of ParameterMetaData
Date Fri, 12 Dec 2014 11:40:13 GMT

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

Sebb commented on DBUTILS-117:
------------------------------

However, nor does the Javadoc state that null is not allowed.

It only says it throws:

bq.     SQLException - if a database access error occurs or this method is called on a closed
PreparedStatement

So what should the library do if it does not support the method?
It would be ambiguous to return a ParameterMetaData with a count of 0, because then one cannot
distinguish it from a statement which has no parameters.

Note that there is example code [1] which explicitly checks for null. I'm sure there are others.

Whether null is explicitly allowed or not, clearly it is considered a possibility, so I agree
the code should check for it.

[1] http://www.java2s.com/Code/JavaAPI/java.sql/PreparedStatementgetParameterMetaData.htm

> Error in control the use of ParameterMetaData
> ---------------------------------------------
>
>                 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.7
>
>         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