pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-jdbc@postgresql.org
Subject: Question about refcursors
Date: Sat, 27 Oct 2007 00:55:35 +0200
Message-ID: <fftr98$uhk$1@ger.gmane.org> (raw)

Hi,

I'm trying to add support for refcursors in my JDBC tool and while trying out 
the examples in the docs 
(<http://jdbc.postgresql.org/documentation/82/callproc.html#callproc-resultset;)

I stumbled over something where I'm not sure whether this is intended or simply 
something which was never thought of.


My generic code to call the procedure does basically a prepareCall() (but not 
with the "? =" as I cannot distinguish between a function and a procedure at 
that moment. And it seems to be working.

Now after running the procedure (using execute()) I'm (generically) calling 
getResultSet() on the statement object. And indeed the driver does return a 
ResultSet, but it seems that the actual result of the call is "hidden" inside 
one of the columns of the resultset. If I do a getObject() on that resultset I 
get another result set which indeed is the result of my SELECT in the procedure.

My question: is there a reason why the "real" result cannot be obtained using 
getResultSet() but is wrapped into another ResultSet?

I can check the database to find out if a function or a procedure is called, but 
it would be really cool, if the driver could handle that for me.

I am aware that I'm not using the calls 100% according to the API and the 
documentation, but still :)

Cheers
Thomas




view thread (4+ messages)  latest in thread

Message-ID: <fftr98$uhk$1@ger.gmane.org>
Permalink:  ../fftr98$uhk$1@ger.gmane.org/
Also on:    postgresql.org/message-id/fftr98$uhk$1@ger.gmane.org

 · 

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: spam_eater@gmx.net
  Subject: Re: Question about refcursors
  In-Reply-To: <fftr98$uhk$1@ger.gmane.org>
  References: <fftr98$uhk$1@ger.gmane.org>

* 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