Re: Newby Question - accessing refcursor.

From: Kris Jurka <books(at)ejurka(dot)com>
To: burferd <jarzabek(at)pobox(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Newby Question - accessing refcursor.
Date: 2008-09-25 23:31:24
Message-ID: Pine.BSO.4.64.0809251929100.30128@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Thu, 25 Sep 2008, burferd wrote:

> I'm trying to fetch the data returned from the stored procedure with the
> method listed below.
> When I do, the execute() method throws the following exception:
> ERROR: cursor "<unnamed portal 1>" does not exist

To cursors (without hold) disappear at transaction end. You need to
ensure you have done Connection.setAutoCommit(false) or else the cursor
will disappear before you can fetch from it.

> cs.registerOutParameter(1, java.sql.Types.JAVA_OBJECT);

This should also be Types.OTHER instead of JAVA_OBJECT.

Kris Jurka

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message burferd 2008-09-26 00:11:46 Re: Newby Question - accessing refcursor.
Previous Message burferd 2008-09-25 23:20:31 Newby Question - accessing refcursor.