dcsimg
Get return value from store procedure through JDBC
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ken_Wong
Posted On:   Tuesday, October 16, 2001 12:25 AM

RES: win2K ,JCONNECT5.0 , JDK1.3 , Database Sybase 11.xx

create procedure myproc begin
/* select 'a' , 'b' */
return 2
end

I use {?=call myproc(?,?,?,?)} in prepare call and set the parameter
How can I get this return value 2 in JDBC ?

Re: Get return value from store procedure through JDBC

Posted By:   Bozidar_Dangubic  
Posted On:   Tuesday, October 16, 2001 06:02 AM


CallableStatement cs = conn.prepareCall("execute function myproc(?,?,?,?)") ;
// set in parameters
cs.setXXX(1,XXX) ;
cs.setXXX(2,XXX) ;
cs.setXXX(3,XXX) ;
cs.setXXX(4,XXX) ;

ResultSet rs = cs.executeQuery() ;
rs.next();
int returnedValue = rs.getInt(1);
About | Sitemap | Contact