pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jimmy P Mani <jimmymani@gmail.com>
To: pgsql-admin@postgresql.org
Subject: stored procedure and java
Date: Thu, 10 Feb 2005 05:12:58 -0800
Message-ID: <48f3cd3a05021005123c9b73d4@mail.gmail.com> (raw)

hi all ,
i want to retrieve records from my java program

i am getting these exceptions
pls help me

No class found for refcursor
        at org.postgresql.jdbc1.AbstractJdbc1Connection.getObject(AbstractJdbc1C
onnection.java:693)
        at org.postgresql.jdbc2.AbstractJdbc2Connection.getObject(AbstractJdbc2C
onnection.java:117)
        at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getObject(AbstractJdbc2Re
sultSet.java:147)
        at org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Stat
ement.java:329)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Stat
ement.java:48)
        at UpdateFabric.update(UpdateFabric.java:64)
        at UpdateFabric.main(UpdateFabric.java:50)


CREATE OR REPLACE FUNCTION public.aa() RETURNS refcursor AS 'declare
entrys refcursor; begin open entrys for select mat_no,po_no from
table; return entrys; end;
'  LANGUAGE 'plpgsql' VOLATILE;

my java function is

public static void update()
     {

     try
     {

     CallableStatement s1 = con.prepareCall("{?=call aa()}");
                 
     s1.registerOutParameter(1,Types.OTHER);
                
     s1.execute();
     ResultSet rs1 = (ResultSet) s1.getObject(1);

     while (rs1.next())
     {

     System.out.println((ResultSet)rs1.getObject(1));
     }
     rs1.close();
     s1.close();


     }catch(Exception e){e.printStackTrace();}


     }

my connection string is

Class.forName("org.postgresql.Driver");

Connect = DriverManager.getConnection("jdbc:postgresql://ip/db","72093701","");

------------------------------------------

is this exception is due to any problem of pgsql driver.
if so where we will get the new driver.

please help me soon
thanks in advance



Message-ID: <48f3cd3a05021005123c9b73d4@mail.gmail.com>
Permalink:  ../48f3cd3a05021005123c9b73d4@mail.gmail.com/
Also on:    postgresql.org/message-id/48f3cd3a05021005123c9b73d4@mail.gmail.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-admin@postgresql.org
  Cc: jimmymani@gmail.com
  Subject: Re: stored procedure and java
  In-Reply-To: <48f3cd3a05021005123c9b73d4@mail.gmail.com>
  References: <48f3cd3a05021005123c9b73d4@mail.gmail.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