Re:

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: News Subsystem <news(at)news(dot)hub(dot)org>, List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re:
Date: 2013-02-21 14:05:55
Message-ID: CADK3HH+gULQ6dcRZ0euKZ63r8_jNjJN5HeJ0Pq5dCHvtRSoq4Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Going from my vague memory. We need the ? as a placeholder for the
parameter. AFAIR this is a legitimate use of the API.

Dave

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca

On Wed, Feb 20, 2013 at 9:01 AM, News Subsystem <news(at)news(dot)hub(dot)org> wrote:

> Wed, 20 Feb 2013 06:01:21 -0800 (PST)
> Wed, 20 Feb 2013 06:01:21 -0800 (PST)
> X-Newsgroups: pgsql.interfaces.jdbc
> Date: Wed, 20 Feb 2013 06:01:21 -0800 (PST)
> Complaints-To: groups-abuse(at)google(dot)com
> Injection-Info: glegroupsg2000goo.googlegroups.com;
> posting-host=174.115.190.53;
> posting-account=hKFGKAkAAAB4U5rGhRuB_p6PSIbpGEph
> User-Agent: G2/1.0
> MIME-Version: 1.0
> Message-ID: <633775d5-77ad-4f49-bf2e-3d5868e26e04(at)googlegroups(dot)com>
> Subject: question about PG JDBC expects results of procedures to be
> consumed
> From: thesix campbells <the6campbells(at)gmail(dot)com>
> Injection-Date: Wed, 20 Feb 2013 14:01:21 +0000
> Content-Type: text/plain; charset=ISO-8859-1
> To: pgsql-jdbc(at)postgresql(dot)org
>
> Can someone clarify why the PG/JDBC driver will not support this style of
> JDBC methods to consume result sets and instead requires the 2nd form. I
> see examples of how (re 2nd) but not necessarily explanation re why other
> approaches may not be supported.
>
> org.postgresql.util.PSQLException: Bad value for type int : <unnamed
> portal 1>
>
> String sproc = "{call pres()}";
> CallableStatement cs = conn.prepareCall(sproc);
> boolean hasResults = cs.execute();
> while (hasResults) {
> rs = cs.getResultSet();
> while (rs.next()) {
> ....
> }
> rs.close();
> hasResults = cs.getMoreResults();
> }
> cs.close();
>
>
> String sproc = "{? = call pres()}";
> CallableStatement cs = conn.prepareCall(sproc);
> cs.registerOutParameter(1, Types.OTHER);
> cs.execute();
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

In response to

  • at 2013-02-20 14:01:23 from News Subsystem

Browse pgsql-jdbc by date

  From Date Subject
Next Message Maz Mohammadi 2013-02-22 03:55:27 confirming security.
Previous Message Ioana Danes 2013-02-21 12:28:20 Ioana Danes