SQL/MX 3.2.1 Guide to Stored Procedures in Java (H06.26+, J06.15+)
LANGUAGE JAVA
PARAMETER STYLE JAVA
MODIFIES SQL DATA;
For details, see Chapter 4: Registering SPJs in NonStop SQL/MX.
5. Grant privileges to users for invoking each SPJ:
GRANT EXECUTE
ON PROCEDURE samdbcat.persnl.adjustsalary
TO "HR.MGRNA", "HR.MGREU"
WITH GRANT OPTION;
GRANT SELECT, UPDATE (salary)
ON TABLE samdbcat.persnl.employee
TO "HR.MGRNA", "HR.MGREU"
WITH GRANT OPTION;
For details, see Granting Privileges for Invoking SPJs (page 83).
6. Invoke each SPJ by using the CALL statement:
CALL samdbcat.persnl.adjustsalary(29,2.5, ?);
NEWSALARY
------------
139400.00
--- SQL operation complete.
For details, see Chapter 5: Invoking SPJs in NonStop SQL/MX.
7. Maintain privileges and manage the metadata of SPJs in the database environment. See
Chapter 6: Managing SPJs in NonStop SQL/MX.
8. Monitor the performance of SPJs and resolve common problems with SPJs in NonStop SQL/MX.
See Chapter 7: Performance and Troubleshooting.
Benefits of SPJs
SPJs provide an efficient and secure way to implement business logic in an SQL/MX database.
SPJs offer the advantages discussed next.
Java Methods Callable From NonStop SQL/MX
With support for SPJs, Java methods are callable from any SQL/MX application on a NonStop
system. For example, you can invoke the same SPJ method from embedded SQL programs in C,
C++, or COBOL and from HP NonStop ODBC/MX clients. By using NonStop SQL/MX to invoke
Java methods, you can extend the functionality of an SQL/MX database and share business logic
among different applications.
Benefits of SPJs 19










