Granting permissions to DerbyThis section discusses which permissions should be granted to (the code base
derby.jar).Permissionsgranting to Derby
See Default Policy Implementation and Policy File Syntax at http://download.oracle.com/javase/1.4.2/docs/guide/security/PolicyFiles.html for
more information about creating policy files.
Allows to read
individual properties
set in the JVM machine's system set. If the action is denied, properties in the JVM machine's
system set are ignored.
This property is used by Derby to prevent the accidental boot of the database
by two class loaders. If the database is booted by two class loaders, database
corruption can occur.
If write permission for this property is not granted, a message is printed
to the log file which indicates that the database
is not protected from dual boot and possible corruption.
Allows to determine
the system directory when set by derby.system.home and create it if
needed. If the system directory already exists then only the "read" permission
needs to be granted.
Used by to determine if the
system is 32 or 64 bit, if the system property sun.arch.data.model isn't set by
the JVM. has to recognize the value of
os.arch to determine if the system is 32 or 64 bit, and if the value isn't recognized
a heuristic will be used instead.
Only one of these permissions is needed. Permits the application to read,
write, and delete to the log
file, unless the log has been re-directed. (See the derby.stream.error properties
in the for more
information.) If one of the requested valid actions is denied, the log
will be java.lang.System.err.
You need this permission if you want to change the security policy on
the fly and reload it into a running system. Given this permission, a DBA
can reload the policy file by calling the SYSCS_UTIL.SYSCS_RELOAD_SECURITY_POLICY system
procedure. For more information, see the section which describes this procedure
in the .
Allows to set the context class loader for long running threads to null to avoid potential for class loader leaks in application server environments when the application server starts in a custom class loader.
This permission is also needed when setting the context class loader to avoid class loader leaks. The class loader for the parent is saved and set to null before creation of the thread and restored afterwards.
Allows Derby to create an MBean server. If the JVM running Derby supports
the platform MBean server, Derby will automatically try to create such a
server if it does not already exist. For details, visit the wiki page
http://wiki.apache.org/db-derby/DerbyJMX.
Allows Derby to register and unregister its (JMX) MBeans. Such MBeans are
associated with the domain org.apache.derby, which is also the prefix of
the fully qualified class name of all Derby MBeans. For more information about
Derby's MBeans, refer to the public API (Javadoc) documentation of the package
org.apache.derby.mbeans and its subpackages. It is possible to fine-tune
this permission, for example in order to allow access only to certain MBeans.
To fine-tune this permission, see the API documentation for
javax.management.MBeanPermission
or the JMX Instrumentation and Agent Specification.
Allows code to
contact the LDAP server to perform authentication. This permission must be
granted to derby.jar. Port 389 is the default LDAP port.
permission java.sql.SQLPermission "callAbort";
Allows code to call
the java.sql.Connection.abort method. This permission must be
granted both to the
JDBC driver (by granting it to derby.jar and
derbyclient.jar) and to the application code that calls
Connection.abort(). Do not grant this permission to application
code unless you are certain that only superusers can invoke the code.
Combining permissions
You might grant one FilePermission that
encompasses several or all of the permissions instead of separately granting
a number of the more specific permissions. For example:permission java.io.FilePermission "${derby.system.home}/-", "read,write,delete";
This allows the engine
complete access to the system directory and any databases contained in the
system directory.