From: dmp <danap@ttc-cmc.net>
To: Thomas Kellerer <spam_eater@gmx.net>
To: PostgreSQL JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: Re: CallableStatement.getParameterMetaData() throws exception for valid {call ...} statement
Date: Tue, 02 Jun 2015 10:40:11 -0600
Message-ID: <556DDC6B.3010409@ttc-cmc.net> (raw)
In-Reply-To: <mkillq$bni$1@ger.gmane.org>
References: <mkbrv5$vfc$1@ger.gmane.org>
<556A1477.2050506@ttc-cmc.net>
<mkillq$bni$1@ger.gmane.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
Thomas Kellerer wrote:
> dmp wrote on 30.05.2015 21:50:
>> Seems to work fine, maybe I have it wrong?
>>
> ~
> ~
> ~
> interesting, your code indeed works.
>
> After playing around with it, the difference is that I call
> getParameterMetaData() *before* calling registerOutParameter().
>
>
> So getParameterMetaData() seems to only work after all OUT parameters have been
> registered (I also tried calling it after the first registerOutParameter() -
> failed as well).
>
> So how can I retrieve the information about the parameters if I can't call
> getParameterMetaData() before registering the parameters (which I try to detect
> by calling that method).The JDBC JavaDocs do not mention such a restriction.
>
>
> Thomas
According to the Java 7 API it seems this interface is mainly associated with
PreparedStatements and lucky to get any information from a CallableStatement.
---------------
public interface ParameterMetaData
extends Wrapper
An object that can be used to get information about the types and properties
for each parameter marker in a PreparedStatement object. For some queries
and driver implementations, the data that would be returned by a
ParameterMetaData object may not be available until the PreparedStatement
has been executed.
Some driver implementations may not be able to provide information about
the types and properties for each parameter marker in a CallableStatement object.
---------------
From the context of your question, it seems what you are looking for is the
information about the function, parameters, etc. When I first looked at this
I searched the database for the newly created sum_n_product() function to
find information about it. It seemed to be abscured. Perhaps that information
stored in the database is the answer to your question rather then this interface.
danap.
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
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: danap@ttc-cmc.net, spam_eater@gmx.net
Subject: Re: CallableStatement.getParameterMetaData() throws exception for valid {call ...} statement
In-Reply-To: <556DDC6B.3010409@ttc-cmc.net>
References: <mkbrv5$vfc$1@ger.gmane.org> <556A1477.2050506@ttc-cmc.net> <mkillq$bni$1@ger.gmane.org> <556DDC6B.3010409@ttc-cmc.net>
* 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