X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 88611D1B442 for ; Thu, 29 Jul 2004 19:14:46 -0300 (ADT) 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 95528-02 for ; Thu, 29 Jul 2004 22:14:46 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 1FA57D1B215 for ; Thu, 29 Jul 2004 19:14:42 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1BqJAW-0005kD-00; Fri, 30 Jul 2004 10:14:32 +1200 Message-ID: <410976C5.2050600@opencloud.com> Date: Fri, 30 Jul 2004 10:14:29 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeremiah Jahn Cc: Matt Verran , postgres jdbc Subject: Re: Java Studio Creator and postgresql jdbc References: <000801c45e15$e3205e50$060313ac@GREYMONKEY> <40E26C02.2050704@opencloud.com> <1091122800.10733.328.camel@bluejay.goodinassociates.com> In-Reply-To: <1091122800.10733.328.camel@bluejay.goodinassociates.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200407/328 X-Sequence-Number: 10712 Jeremiah Jahn wrote: > bit of a repost here: > I got the following from sun on this. > > Re: Supported DB Drivers > Author: Valerie_Lipman > Jul 25, 2004 2:02 PM > (reply 4 of 4) > > We just tested postgresql in house and found that the driver is > returning null for PreparedStatement.getMetaData() The current driver returns null from getMetaData() if there is no active resultset associated with the statement. The javadoc says: > Retrieves a ResultSetMetaData object that contains information about the > columns of the ResultSet object that will be returned when this > PreparedStatement object is executed. > > Because a PreparedStatement object is precompiled, it is possible to > know about the ResultSet object that it will return without having to > execute it. Consequently, it is possible to invoke the method > getMetaData on a PreparedStatement object rather than waiting to execute > it and then invoking the ResultSet.getMetaData method on the ResultSet > object that is returned. This is probably possible to implement when using a V3 connection (server version >= 7.4) as we can send Parse/Bind/Describe/ClosePortal to get a description of the portal without actually executing it. The driver doesn't do this currently though. I'd point out that it's probably the application at fault too. The javadoc goes on to say: > Returns: > the description of a ResultSet object's columns or null if the > driver cannot return a ResultSetMetaData object So 'null' is actually a legal return value (in fact, we'll probably have to continue returning null when using a V2 connection). -O