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

Registering SPJs in NonStop SQL/MX
HP NonStop SQL/MX Guide to Stored Procedures in Java523727-004
4-9
Specifying the External Path
NonStop SQL/MX returns an error if the compressed signature exceeds 8192
characters. For more information about javap, see the NonStop Server for Java Tools
Reference Pages.
For example, consider the SPJ method, adjustSalary():
public static void adjustSalary(BigDecimal empNum,
double percent,
BigDecimal[] newSalary)
...
The Java signature of this method in the CREATE PROCEDURE statement, if you
choose to specify it, is:
(java.math.BigDecimal, double, java.math.BigDecimal[])
After you register the SPJ (that is, issue the CREATE PROCEDURE statement), you
can display the compressed Java signature in the TEXT metadata table. Issue this
query:
SELECT SUBSTRING(TEXT,1,100) AS "Compressed Signature"
FROM samdbcat.definition_schema_version_vernum.text t,
nonstop_sqlmx_node.system_schema.all_uids u,
nonstop_sqlmx_node.system_schema.schemata s
WHERE t.object_uid = u.object_uid
AND u.object_name = 'ADJUSTSALARY'
AND u.schema_uid = s.schema_uid
AND s.schema_name = 'PERSNL';
The schema version number vernum for NonStop SQL/MX Releases 2.0 and 2.1 is
1200.
The query displays the compressed Java signature of the ADJUSTSALARY procedure:
For more information about the TEXT metadata table, see the SQL/MX Reference
Manual.
Specifying the External Path
The external path specifies the location of the Java class file that contains the SPJ
method. The external path is a case-sensitive string identifying the OSS directory or
JAR file path where the Java class file (for example, Payroll.class) resides.
Package Consideration
Do not specify the package name in the EXTERNAL PATH clause. Instead, specify the
package name in the EXTERNAL NAME clause. See Java Method Name on page 4-7.
Compressed Signature
--------------------------------------------------------------------------
(Ljava/math/BigDecimal;D[Ljava/math/BigDecimal;)V