Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.databases > #316

Re: Jave stored procedure

From "Starbuck" <starbuck@THRWHITE.remove-dii-this>
Subject Re: Jave stored procedure
Message-ID <Cg8Nk.79588$WX2.67127@newsfe17.ams2> (permalink)
Newsgroups comp.lang.java.databases
References <d98Nk.79587$WX2.62145@newsfe17.ams2>
Date 2011-04-27 15:23 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.databases
Starbuck wrote:
> Hi Guys
> 
> Can anyone see what is wrong here
> 
> CallableStatement cs = con.prepareCall("{ ? = call list_index () }");
> cs.registerOutParameter(1, Types.OTHER);
> cs.execute();
> ResultSet rs = (ResultSet) cs.getObject(1);
> while (rs.next())
> {
>     //read the returned recordset   
> }
> 
> 
> When  - ResultSet rs = (ResultSet) cs.getObject(1);
> is executed the error is - "[B cannot be cast to java.sql.ResultSet"
> 
> The stored procedure being called is as follows, it works fine in c#
> 
> CREATE PROCEDURE list_index
> AS
> BEGIN
>   /* Procedure body */
>   SELECT name FROM listtypes where ctype = 'C' order by ndx
> END
> 
> Thanks in advance chaps.

Its ok, silly me

//ResultSet rs = (ResultSet) cs.getObject(1);
ResultSet rs = cs.executeQuery();

Works fine now.
This Java is rather cool eh.

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.databases | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Jave stored procedure que "Starbuck" <starbuck@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
  Re: Jave stored procedure "Starbuck" <starbuck@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
    Re: Jave stored procedure "=?ISO-8859-1?Q?Arne_Vajh=" <=?iso-8859-1?q?arne_vajh=@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
      Re: Jave stored procedure "Starbuck" <starbuck@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000

csiph-web