pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: David Gagnon <dgagnon@siunik.com>
Cc: pgsql-jdbc@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: [JDBC] plpgsql function with RETURNS SETOF refcursor  AS.  How
Date: Thu, 24 Mar 2005 18:44:05 -0500 (EST)
Message-ID: <Pine.BSO.4.56.0503241840570.31387@leary.csoft.net> (raw)
In-Reply-To: <42434D89.5080104@siunik.com>
References: <42434D89.5080104@siunik.com>



On Thu, 24 Mar 2005, David Gagnon wrote:

>   I'm already able to get Refcursor from a stored procedure.  But now I 
> need to get a SETOF refcursor and I can't make it work... Is that 
> possible to do this via JDBC?
> 
> He is the code I did.   The rsTmp.next() throws a  Connection is 
> closed.  Operation is not permitted. Exception. 
> 
> 
>         rs = new ResultSet[j];
>         System.arraycopy(tempArray, 0, rs, 0, j);
>         rsTmp.close();

System.arraycopy does not make a deep copy, so the rsTmp.close() closes 
the ResultSet.  You really can't copy resources around like that.  
Consider how you would copy a Connection object.  Does that establish a 
new connection?  The underlying tcp/ip connection can't be copied.

Kris Jurka




view thread (21+ messages)  latest in thread

Message-ID: <Pine.BSO.4.56.0503241840570.31387@leary.csoft.net>
Permalink:  ../Pine.BSO.4.56.0503241840570.31387@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.56.0503241840570.31387@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, dgagnon@siunik.com, pgsql-general@postgresql.org
  Subject: Re: [JDBC] plpgsql function with RETURNS SETOF refcursor  AS.  How
  In-Reply-To: <Pine.BSO.4.56.0503241840570.31387@leary.csoft.net>
  References: <42434D89.5080104@siunik.com> <Pine.BSO.4.56.0503241840570.31387@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