Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Callabe Statement Return Values  RSS feed

Naresh Shaan
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);

status = (String) call.getString(1);
System.out.println("Status : "+status);

i am getting null in status.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!