The typical resultset in Java can hold the rows of a query. I usually call stored procedures to keep it clean.

I was wondering if there was a way to get back a stored procedure's RETURN value or OUTPUT value instead. The common example is when a stored procedure does an INSERT and needs to RETURN the primary key of the new record to the caller. I'd do a SELECT of that same key but sometimes certain procedures need to be called from other stored procedures - in which case RETURN values are the best way to tell the parent procedure (transaction) what record was inserted.

Does JDBC allow this? I couldn't find anything in the JDBC documentation that led to this.

Thanks for your help