SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-62
CREATE PROCEDURE Statement
For more information, see Data Types on page 6-16.
EXTERNAL NAME 'java-method-name [java-signature]'
java-method-name
specifies the case-sensitive name of the SPJ method of the form:
[package-name.]class-name.method-name
The Java method must exist in a Java class file, class-name.class, in the
OSS directory, or the JAR file path specified by the EXTERNAL PATH clause.
The Java method must be defined as public and static and have a return
type of void. For guidelines on how to write an SPJ method, see the SQL/MX
Guide to Stored Procedures in Java.
If the class file that contains the SPJ method is part of a package, you must
also specify the package name. If you do not specify the package name, the
CREATE PROCEDURE statement fails to register the SPJ.
java-signature
specifies the signature of the SPJ method and consists of:
([java-datatype[{, java-datatype}...]])
The Java signature is necessary only if you want to specify a Java wrapper
class (for example, java.lang.Integer) instead of a Java primitive data
type (for example, int). An SQL/MX data type maps to a Java primitive data
type by default.
The Java signature is case-sensitive and must be placed within parentheses,
such as (java.lang.Integer, java.lang.Integer). The signature
must specify each of the parameter data types in the order they appear in the
Java method definition within the class file. Each Java data type that
corresponds to an OUT or INOUT parameter must be followed by empty
square brackets ([ ]), such as java.lang.Integer[].
java-datatype
specifies a mappable Java data type. For the mapping of the Java data
types to SQL/MX data types, see sql-datatype on page 2-61.
EXTERNAL PATH 'class-file-path'
specifies a case-sensitive string identifying the OSS directory or the JAR file path
where the Java class file that contains the SPJ method resides.
This icon indicates an SQL data type that is an SQL/MX extension to
the ANSI standard. All other SQL data types in this table conform to
the ANSI standard.
Ext