commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] [Commented] (DBUTILS-117) Error in control the use of ParameterMetaData
Date Mon, 15 Dec 2014 10:57:14 GMT


Sebb commented on DBUTILS-117:

bq. I would expect the driver to throw SQLFeatureNotSupportedException.

This is a subclass of SQLException.

However the Javadoc for getParameterData() states:

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

Is an unsupported feature really a database access error?

So the Javadoc for getParameterData() is inconclusive. It does not say what should happen
if the method is not supported.

Therefore I think Commons should take steps to support implementations if it can easily do
It already supports SQLFeatureNotSupportedException because it catches SQLException.
[Though whether that is the correct thing to so is another matter, as there are other reasons
for SQLException that are nothing to do with lack of support for getParameterData(), i.e.
it may incorrectly assume it is not supported]

It's clear from existing published code that returning null is an expected response, so I
think DBUtils should support that.
It's a very simple change. What harm can it do?

> Error in control the use of ParameterMetaData
> ---------------------------------------------
>                 Key: DBUTILS-117
>                 URL:
>             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

View raw message