Cloudscape Properties
Page 9 of 47

cloudscape.database.classpath

Function

Enables class loading from the database. For a complete discussion of database class loading, see Loading Classes from a Database of the Cloudscape Developer's Guide.

Takes a list of fully qualified jar names that indicates which jar files the Cloudscape class loader should search for classes and other resources, and in which order. The search order is from left to right, so this property behaves like the standard class path.

The class loader looks first in the user's class path, then in the jar files specified with this property. To ensure class loading from the database, remove classes from the user's class path.

You can set this property for the following kinds of storage:

  • Database storage. Classes are stored in the current database and are not available across databases. Recommended.

    Set it as a database-level property.

    The fully qualified name consists of a two-part name: schema name and an unqualified jar name.

  • System storage. Classes are stored in the database you specify and are available across databases. Not recommended (but corresponds to Version 1.5 behavior and allows sharing across databases).

    Set it as a system-level property.

    The fully qualified name consists of a three-part name: database name, a schema name, and an unqualified jar name.

    Does not work when a database has user authentication turned on, because the system does not provide a user name and password when accessing the classes stored in the database.

NOTE: Do not mix two-part and three-part names. Such property values are invalid.

To specify multiple jar files, use a colon (:) as a separator.

Syntax

-- database-level, set only in an SQL-J statement
CALL PropertyInfo.setDatabaseProperty(
    'cloudscape.database.classpath', 'schemaName.
    unqualifiedJarFile[:schemaName.unqualifiedJarFile]*')

-- System-level
cloudscape.database.classpath=databaseName.schemaName.
unqualifiedJarFile[:databaseName.schemaName.unqualifiedJarFile]*

Example

To set the search path for the current database to be from APP.photo and APP."AccountinG":

-- database-wide property
CALL PropertyInfo.setDatabaseProperty(
    'cloudscape.database.classpath',
    'APP.photo:APP."AccountinG"')

To set the search path for Java classes to be from database photodb, schema APP, and jar file photo followed by database general, schema APP, and jar file jgl:

-- system-wide property
cloudscape.database.classpath=photodb.APP.photo:general.APP.jgl

-- publishing a database-wide property
CREATE PUBLICATION APub
ADD TARGET DATABASE PROPERTY
cloudscape.database.classpath=
    'APP.photo:APP."AccountinG"'

Scope

system-wide (see notes above)

database-wide (see notes above) (publishable)

Dynamic or Static

For database storage, the first time this property is set, it is static; rebooting the database is required. If this property is set as a database property (and the value is valid), thereafter, the next time the property is set as a database-level property, no rebooting is required; the change is dynamic (see Dynamic Changes to Jar Files or Database Jar Class Path of the Cloudscape Developer's Guide). All other changes are static and require rebooting.

For information about dynamic changes to properties, see Dynamic or Static Changes to Properties.