SQL/MX Guide to Stored Procedures in Java (G06.24+, H06.03+)

Writing SPJ Methods
HP NonStop SQL/MX Guide to Stored Procedures in Java523727-004
3-2
Returning Output Values From the Java Method
Java Parameters
The parameter types in the Java signature must correspond to the SQL parameters of
the stored procedure that you are planning to create. For type mappings, see
Table 3-1.
Output parameters in the Java signature must be arrays (for example, int[] or
String[]) that accept only one value in the first element of the array at index 0. For
more information, see Returning Output Values From the Java Method.
Returning Output Values From the Java Method
Output parameters in the Java signature must be parameter arrays that accept one
value in the first element of the array at index 0. This subsection covers these topics
related to output parameters:
Using Arrays for Output Parameters on page 3-3
Type Mapping of Output Parameters on page 3-3
Stored Procedure Result Sets on page 3-4
Table 3-1. Mapping of Java Data Types to SQL/MX Data Types
Java Data Type Maps to SQL/MX Data Type...
java.lang.String CHAR[ACTER]
CHAR[ACTER] VARYING
VARCHAR
PIC[TURE] X
NCHAR
NCHAR VARYING
NATIONAL CHAR[ACTER]
NATIONAL CHAR[ACTER] VARYING
java.sql.Date DATE
java.sql.Time TIME
java.sql.Timestamp TIMESTAMP
java.math.BigDecimal NUMERIC
DEC[IMAL]
PIC[TURE] S9
short SMALLINT
int or java.lang.Integer
*
INT[EGER]
long or java.lang.Long
*
LARGEINT
double or java.lang.Double
*
FLOAT
float or java.lang.Float
*
REAL
double or java.lang.Double
*
DOUBLE PRECISION
*
Choose a Java wrapper class if you plan to pass null values as arguments to or from the method. See Null
Input and Output on page 3-4.