Re: PreparedStatement.getParameterMetaData

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Aaron Mulder <ammulder(at)alumni(dot)princeton(dot)edu>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: PreparedStatement.getParameterMetaData
Date: 2005-11-21 00:24:37
Message-ID: 438113C5.4020301@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Nathan McEachen 2005-11-21 04:24:07 Creating a database using ant
Previous Message Oliver Jowett 2005-11-21 00:13:57 Re: passing array as parameters to PrepareStatement or callable