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

Getting Started
HP NonStop SQL/MX Guide to Stored Procedures in Java523727-004
2-27
SPJ Policy File and Required Permissions
SPJ Policy File and Required Permissions
The default SPJ policy file, mxlangman.policy in the /usr/tandem/sqlmx/udr
directory, contains these permissions:
You can use the default SPJ policy file, mxlangman.policy, as is, reconfigure it, or
use your own policy file. The policy file that you specify must contain certain
permissions for SPJs to operate properly in the SPJ environment. Details are
discussed next.
Permissions for the SQL/MX Language Manager
The SQL/MX language manager is a key component because it loads, invokes, and
unloads SPJs in an SQL/MX UDR server process. The mxlangman.jar file contains
Java bytecode that implements part of the SQL/MX language manager.
You must grant these permissions in the SPJ policy file for the SQL/MX language
manager to operate properly:
grant codeBase "file:/usr/tandem/sqlmx/udr/mxlangman.jar" {
permission java.security.AllPermission;
};
If the SPJ policy file does not contain these permissions, all CALL statements fail and
return errors that describe a security-related problem with the SQL/MX language
manager.
Permissions for the JDBC/MX Driver
If you plan to call SPJs that access a database (that is, JDBC/MX-based or SQLJ-
based SPJs), you must grant these permissions in the SPJ policy file for JDBC/MX
product to operate properly:
grant codeBase
"file:/usr/tandem/jdbcMx/current/lib/jdbcMx.jar" {
permission java.security.AllPermission;
};
Specify the standard location (/usr/tandem/jdbcMx/current/lib/
jdbcMx.jar) or a nonstandard location that you specify in the UDR extensions class
path. For more information, see Setting the JDBC/MX Location on page 2-20.
grant codeBase "file:/usr/tandem/sqlmx/udr/mxlangman.jar" {
permission java.security.AllPermission;
};
grant codeBase
"file:/usr/tandem/jdbcMx/current/lib/jdbcMx.jar" {
permission java.security.AllPermission;
};
grant codeBase "file:/usr/tandem/sqlmx/lib/sqlj.jar" {
permission java.security.AllPermission;
};