问题
I have a stored procedure which returns an Integer as well as an Out Parameter which is of type VARCHAR.
I am using Spring 2.5.6 and unable to find a way to read the return value as well as Out Parameter at the same time.
SimpleJdbcCall.executeFunction(..) have a facility to read the stored procedure return value but no facility for Out Parameter.
SimpleJdbcCall.execute(..) can read Out parameters.
There are other ways also in Spring to do the above.
Am I missing something in Spring which can read both at the same time or the stored procedure is wrong as it should only use Out Param or Return Value but not both at same time?
回答1:
If you are using Spring 2.5X, I believe that SimpleJdbcCall#withReturnValue() specifies that you want the return value to be included in the return results. I'm not sure what the entry will be keyed to in the Map, but I'd try that out.
来源:https://stackoverflow.com/questions/1911889/how-to-call-stored-procedure-to-read-return-value-and-out-parameter-both-in-spri