Обсуждение: PreparedStatement.getParameterMetaData

Поиск
Список
Период
Сортировка

PreparedStatement.getParameterMetaData

От
Aaron Mulder
Дата:
I noticed yesterday that this does not seem to be working in the
released drivers for 7.3 or 8.0.  In the 7.3 build from the web site
(no version in the name), I got something like an unimplemented
exception.  In the 8.0 build (314) I got a null.  I haven't tried the
8.1 build as it seemed a little risky against an old 7.3 database.

Aaron

Re: PreparedStatement.getParameterMetaData

От
Oliver Jowett
Дата:
Aaron Mulder wrote:
> I noticed yesterday that this does not seem to be working in the
> released drivers for 7.3 or 8.0.  In the 7.3 build from the web site
> (no version in the name), I got something like an unimplemented
> exception.  In the 8.0 build (314) I got a null.  I haven't tried the
> 8.1 build as it seemed a little risky against an old 7.3 database.

As you discovered, older drivers don't implement the method at all. From
memory it was first implemented in the 8.0 driver.

However, the driver needs to be using the version 3 wire protocol to get
parameter metadata from the server. That protocol is only supported by
servers from 7.4 onwards, so you're out of luck against a 7.3 server.

It's not clear from the JDBC javadoc whether getParameterMetaData()
should return null, return a dummy object, or throw an exception when no
metadata is available. We currently return null. Returning a dummy
object seems hard since there is no way to return "unknown" across all
methods in the metadata interface.

-O