pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Damon Anderson <anderson@eclipse.knight-rider.org>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: bug with 8.X level 4 driver?
Date: Tue, 6 Dec 2005 10:34:06 -0500 (EST)
Message-ID: <Pine.BSO.4.61.0512061031060.5324@leary.csoft.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0512060024150.2074@eclipse.knight-rider.org>
References: <Pine.LNX.4.64.0512060024150.2074@eclipse.knight-rider.org>



On Tue, 6 Dec 2005, Damon Anderson wrote:

> So did some searching on the forums, lists, etc.. Changed it to this:
> try
> {
>    ppS = dd.createPPStatement();
>    ppS.setQueryString(
>                  "INSERT INTO sandwich_side (name) VALUES ('pickles');" +
>                  "INSERT INTO sandwich ( name, sideid) VALUES('club', 
> currval('sandwich_side_id_seq'));" +
>                  "SELECT currval('sandwich_side_id_seq')");
>    ppS.initStatement();  //Prepares the statement.
>    ppS.getPreparedStatement().execute();
>    if( ppS.getPreparedStatement().getMoreResults())
>      rs = ppS.getPreparedStatement().getResultSet();

What this is going to retrieve is two update counts and two ResultSets. 
This means you need to call getMoreResults twice to get to the first 
ResultSet.

Kris Jurka



view thread (4+ messages)  latest in thread

Message-ID: <Pine.BSO.4.61.0512061031060.5324@leary.csoft.net>
Permalink:  ../Pine.BSO.4.61.0512061031060.5324@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.61.0512061031060.5324@leary.csoft.net

 · 

reply

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: books@ejurka.com, anderson@eclipse.knight-rider.org
  Subject: Re: bug with 8.X level 4 driver?
  In-Reply-To: <Pine.BSO.4.61.0512061031060.5324@leary.csoft.net>
  References: <Pine.LNX.4.64.0512060024150.2074@eclipse.knight-rider.org> <Pine.BSO.4.61.0512061031060.5324@leary.csoft.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