Nonstop Database, HiRDB Version 9 UAP Development Guide
This section explains the mapping of the SQL parameter input/output mode (IN, OUT, or INOUT) with Java stored procedures. You cannot specify a parameter input/output mode for a Java stored function.
For details about mapping, see the type mapping in the HiRDB Version 9 SQL Reference manual.
The following figure shows an example of parameter input/output mode mapping.
Figure 9-10 Example of parameter input/output mod mapping
For a parameter defined as an IN parameter with SQL, a Java program uses the corresponding data type as is.
Suppose that the IN parameter is defined as an INTEGER type with the CREATE PROCEDURE SQL statement. With a Java program, it is defined as the corresponding int type or java.lang.Integer type (param1 and jparam1 in Figure 9-10).
For a parameter defined as an OUT or INOUT parameter with SQL, a Java program defines it as the array type of the corresponding data type. The OUT and INOUT parameters are implemented in this manner because a parameter is to be passed as a one-element array of the corresponding data type with the pointer representation method in the Java language.
Suppose that the OUT parameter is defined as SMALLINT type with the CREATE PROCEDURE SQL statement. With a Java program, it is defined as the array type of the corresponding short or java.long.Short type (param2 and jparam2; param3 and jparam3 in Figure 9-10). To return a value to the OUT or INOUT parameter, set the value at the beginning of the array (jparam2 and jparam3 in Figure 9-10).
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.