I have a stored procedure with an out parameter so I think it should return a value (correct me if I am wrong). I am calling the stored procedure in my java program. How do I get the value to my java program. I want to use the returned value in another operation.
posted 9 years ago
You need to do the following.
Assume stmt is the CallableStatement object that is returned from prepareCall() and all input has been set.
stmt.registerOutParameter(<the position of the output parameter>, java.sql.Types.<whatever type it is>);
Then, after execution:
String value = stmt.getString(<the position of the output parameter>);