X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C9CF9D8216 for ; Sun, 20 Nov 2005 20:24:39 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 83537-02 for ; Mon, 21 Nov 2005 00:24:41 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [131.203.101.226]) by svr1.postgresql.org (Postfix) with ESMTP id 2B4BCD8036 for ; Sun, 20 Nov 2005 20:24:37 -0400 (AST) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1EdzU6-0004l6-GI; Mon, 21 Nov 2005 13:24:38 +1300 Message-ID: <438113C5.4020301@opencloud.com> Date: Mon, 21 Nov 2005 13:24:37 +1300 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051009) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Aaron Mulder CC: pgsql-jdbc@postgresql.org Subject: Re: PreparedStatement.getParameterMetaData References: <74e15baa0511200849x7cd6284dic27dbe95cca08bcf@mail.gmail.com> In-Reply-To: <74e15baa0511200849x7cd6284dic27dbe95cca08bcf@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/128 X-Sequence-Number: 14226 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