ASA Programming Guide
Using Java in the Database
Special features of Java classes in the database
Java provides security managers than you can use to control user access to security-sensitive features of your applications, such as file access and network access. Adaptive Server Anywhere provides the following support for Java security managers in the database:
Adaptive Server Anywhere provides a default security manager.
You can provide your own security manager.
For information, see Implementing your own security manager.
The default security manager is the class com.sybase.asa.jrt.SAGenericSecurityManager. It carries out the following tasks:
It checks the value of the database option JAVA_INPUT_OUTPUT.
It checks whether the database server was started in C2 security mode using the -sc
database server option.
If the connection property is OFF, it disallows access to Java file I/O features.
If the database server is running in C2 security mode, it disallows access to java.net packages.
When the security manager prevents a user from accessing a feature, it returns a java.lang.SecurityException.
For more information, see JAVA_INPUT_OUTPUT option [database], and -sc server option.
Java file I/O is controlled through the JAVA_INPUT_OUTPUT database option. By default this option is set to OFF, disallowing file I/O.
To permit file access using the default security manager
Set the JAVA_INPUT_OUTPUT option to ON:
SET OPTION JAVA_INPUT_OUTOUT='ON'