Deploying Synchronized Systems
Page 4 of 4

Locally Configuring Target Database Properties

You can directly set database-wide properties for target databases. Locally setting target database properties enables users to configure individual targets differently. For example, an application could configure each target to support a different set of users. Setting properties from the target database is optional; you can continue to publish properties as well.

For a full discussion of properties, see the Tuning Cloudscape Guide.

Setting Properties

Full-access users can set target database properties locally. Setting database-wide properties from the target is handled in the same way as doing so from the source:

  • connect to the database
  • create a SQL-J statement
  • from inside the statement, call the setDatabaseProperty method, passing in the name and value of the property.

NOTE: The setDatabaseProperty method is in the COM.cloudscape.database.PropertyInfo class, for which Cloudscape has provided the alias PropertyInfo.

The following example demonstrates using ij to:

    • create a copy file
    • create and connect to a target database
    • set a target database property (p1) to the value `p1val'
    • verify its value


      ---create the copy file

ij> CONNECT 'sourceDB';
ij> CREATE PUBLICATION p1 ADD TABLE mytab;
ij> COPY PUBLICATION p1 TO FILE 'p1.cpy';
---create and connect to the target and set the property
ij> Connect 'targDB;createTargetFrom=p1.cpy';
ij> CALL PropertyInfo.setDatabaseProperty('p1','p1val');
ij> VALUES PropertyInfo.getDatabaseProperty('p1');
SQLCol1
------------------------------------
p1val

The next example demonstrates a call that grants full-access user authorization to `Joe' on a target database:

CALL PropertyInfo.setDatabaseProperty(
    'cloudscape.database.fullAccessUsers', 'Joe')

Checking Property Values

To check the current value of a property at a target database, use the getDatabaseProperty method, just as you would at a source or standard database. Connect to the database, then create a SQL-J statement containing the getDatabaseProperty method, passing in the name of the property whose value you want to check. To check the current values of all database-wide properties, use the getProperties() method.

For example, the following statement retrieves a list of users with full database access:

VALUES PropertyInfo.getDatabaseProperty(
    'cloudscape.database.fullAccessUsers')

SQLCol1
----------------------------------
Joe

For more information about PropertyInfo, see the Tuning Cloudscape Guide and the API for COM.cloudscape.database.PropertyInfo.