Java SP Wrapper
Java uses pass-by-value, but...
Fields inside object parameters may be modified
DemoProcArg.java source code:
public class DemoProcArg {
public int returnArg;
}
Notes:
One reason to write a stored procedure is that Java does not return values in primitive arguments (simple integers, etc.) whereas stored procedures allow OUT and INOUT parameters. With Java you can modify a field encapsulated within an object parameter, and the wrapper sp can hide the details. In this example DemoProcArg is a Java class created for the sole purpose of returning an integer value as a parameter.