[
https://issues.apache.org/jira/browse/DBUTILS-117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14246549#comment-14246549
]
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 PreparedStatement
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 so.
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: 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)