views:

617

answers:

1

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?

+2  A: 

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.

delfuego
Thanks that worked. The key is "return" in the map.
Bhushan
Great! I learned something new, then, too. :)
delfuego