pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Refcursor class not found
2+ messages / 2 participants
[nested] [flat]

* Refcursor class not found
@ 2004-11-09 12:11 deepthi@granwill.com
  2004-11-09 16:24 ` Re: Refcursor class not found Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 2+ messages in thread

From: deepthi@granwill.com @ 2004-11-09 12:11 UTC (permalink / raw)
  To: pgsql-jdbc

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Refcursor class not found
  2004-11-09 12:11 Refcursor class not found deepthi@granwill.com
@ 2004-11-09 16:24 ` Kris Jurka <books@ejurka.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Kris Jurka @ 2004-11-09 16:24 UTC (permalink / raw)
  To: deepthi@granwill.com; +Cc: pgsql-jdbc



On Tue, 9 Nov 2004 deepthi@granwill.com wrote:

> 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.

Refcursor support only started in the 7.4 driver (which you can use 
against a 7.3 server.)

Kris Jurka




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-11-09 16:24 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-11-09 12:11 Refcursor class not found deepthi@granwill.com
2004-11-09 16:24 ` Kris Jurka <books@ejurka.com>

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