From: Oliver Jowett <oliver@opencloud.com>
To: Jeremiah Jahn <jeremiah@cs.earlham.edu>
Cc: Matt Verran <matt@verranm.fsnet.co.uk>
Cc: postgres jdbc <pgsql-jdbc@postgresql.org>
Subject: Re: Java Studio Creator and postgresql jdbc
Date: Fri, 30 Jul 2004 10:14:29 +1200
Message-ID: <410976C5.2050600@opencloud.com> (raw)
In-Reply-To: <1091122800.10733.328.camel@bluejay.goodinassociates.com>
References: <000801c45e15$e3205e50$060313ac@GREYMONKEY>
<40E26C02.2050704@opencloud.com>
<1091122800.10733.328.camel@bluejay.goodinassociates.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: oliver@opencloud.com, jeremiah@cs.earlham.edu, matt@verranm.fsnet.co.uk
Subject: Re: Java Studio Creator and postgresql jdbc
In-Reply-To: <410976C5.2050600@opencloud.com>
References: <000801c45e15$e3205e50$060313ac@GREYMONKEY> <40E26C02.2050704@opencloud.com> <1091122800.10733.328.camel@bluejay.goodinassociates.com> <410976C5.2050600@opencloud.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox