| Author |
How to Execute Stored Procedure?
|
Sanjay Deshpande
Ranch Hand
Joined: May 22, 2001
Posts: 111
|
|
I have following SP Create Procedure SP_Get_Status ( @Status varchar(40) OUTPUT ) as Begin Select @Status=Status from Status End ---------------------------------------------- My Java Code is like THis con=DriverManager.getConnection(url,"sa",""); CallableStatement cs=con.prepareCall("{call SP_Get_Status(?)}"); cs.registerOutParameter(1, java.sql.Types.VARCHAR); cs.executeQuery(); ------------------------- Question 1.I get exception: No ResultSet was produced Where as this runs fine Question 2:How to get a reslutset OBject out of this?
|
 |
A Sundaram
Greenhorn
Joined: Jan 08, 2003
Posts: 7
|
|
try: ResultSet rs; rs = cs.getResultSet(); while(rs.next()){ //do whatever you want to on the result set }
|
 |
 |
|
|
subject: How to Execute Stored Procedure?
|
|
|