• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Callabe Statement Return Values

 
Naresh Shaan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am working on storedprocedures

and my databse is SQL Server
my storedprocedure is working fine..

and i am returing a value back to my program

when i execute the storedprocedure in SQL Query Analizer it is working and is returning a value

but i am not able to get that returned value in my java program

here are is program

thanx in advance



Connection connection = connectionPool.getConnection();
System.out.println("StoredProcedure Called : "+(String)NameRegistrar.get("CW_pro"));
CallableStatement call=connection.prepareCall("{?=call "+(String)NameRegistrar.get("CW_pro")+"(?,?,?,?)}");
call.registerOutParameter(1, java.sql.Types.VARCHAR);
call.setString(2,msg.getString(2));
call.setInt(3,Integer.parseInt(msg.getString(4)));
call.setString(4,msg.getString(11));
call.setString(5,msg.getString(11));

call.execute();
status = (String) call.getString(1);
System.out.println("Status : "+status);
call.close();
connectionPool.free(connection);




i am getting null in status.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic