pg.ddx.io pgsql-jdbc@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: deepthi@granwill.com
To: pgsql-jdbc@postgresql.org
Subject: Refcursor class not found
Date: Tue, 9 Nov 2004 04:11:30 -0800
Message-ID: <1100002290.4190b3f250932@granwill.com> (raw)
hello everybody,
I have created a function to display the rows in a table. The function is
returning the refcursor. I am calling the refcursor in Callable Statement, but
i am getting No class found for refcursor. I have seen these queries earlier in
this forum.
I am using postgresql 7.3.4 and pg73jdbc3.jar.
As per the solutions given for earlier queries i tried to give getString(1), but
i am getting null value.
i am attaching the code along with this mail.
This is my pl/pgsql
CREATE or REPLACE FUNCTION displayall() RETURNS refcursor AS '
DECLARE
cursor1 cursor for select pageid,keyword from Maintable;
BEGIN
open cursor1;
return cursor1;
END;
'language 'plpgsql';
My jdbc code is
con.setAutoCommit(false);
CallableStatement cstmt2=null;
cstmt2=con.prepareCall("{? = call displayall()}");
cstmt2.registerOutParameter(1,Types.OTHER);
cstmt2.executeUpdate();
ResultSet rs2=(ResultSet)cstmt2.getObject(1);
i am getting No class found for refcursor and the error is pointing to
cstmt2.executeUpdate() line.
I also tried to use
con.setAutoCommit(false);
CallableStatement cstmt2=null;
cstmt2=con.prepareCall("{? = call displayall()}");
cstmt2.registerOutParameter(1,Types.OTHER);
String test=cstmt2.getString(1);
But test is pointing to null.
Can anyone please help me in solving this problem. I need to sort out this issue
at the earliest as i need to use Callable Statement in JDBC and also pl/pgsql.
Reply awaited.
Regards,
deepthi
view thread (2+ messages) latest in thread
Message-ID: <1100002290.4190b3f250932@granwill.com> Permalink: ../1100002290.4190b3f250932@granwill.com/ Also on: postgresql.org/message-id/1100002290.4190b3f250932@granwill.com ·
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: deepthi@granwill.com Subject: Re: Refcursor class not found In-Reply-To: <1100002290.4190b3f250932@granwill.com> References: <1100002290.4190b3f250932@granwill.com> * 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