Re: PreparedStatement.getParameterMetaData - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: PreparedStatement.getParameterMetaData
Date
Msg-id 438113C5.4020301@opencloud.com
Whole thread Raw
In response to PreparedStatement.getParameterMetaData  (Aaron Mulder <ammulder@alumni.princeton.edu>)
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: passing array as parameters to PrepareStatement or callable
Next
From: Tjioe Ai Xin
Date:
Subject: Re: Problem when upgrade PostgreSQL 7.3.3 to PostgreSQL 8.0.3