Re: [JDBC] plpgsql function with RETURNS SETOF refcursor AS. How - Mailing list pgsql-general

From Kris Jurka
Subject Re: [JDBC] plpgsql function with RETURNS SETOF refcursor AS. How
Date
Msg-id Pine.BSO.4.56.0503241840570.31387@leary.csoft.net
Whole thread Raw
In response to plpgsql function with RETURNS SETOF refcursor AS. How to get it work via JDBC  (David Gagnon <dgagnon@siunik.com>)
Responses Re: [JDBC] plpgsql function with RETURNS SETOF refcursor AS. How to  (David Gagnon <dgagnon@siunik.com>)
List pgsql-general

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


pgsql-general by date:

Previous
From: David Gagnon
Date:
Subject: plpgsql function with RETURNS SETOF refcursor AS. How to get it work via JDBC
Next
From: Greg Stark
Date:
Subject: Re: plperl doesn't release memory