getDbFiles

getDbFiles(fileKinds: Integer;
           dbfiles:   DbFileArray input);

The getDbFiles method of the JadeDatabaseAdmin class populates a DbFile array with references to database files of the kinds specified in the fileKinds parameter, by searching all schemas from the RootSchema down through the schema hierarchy.

Use the fileKinds parameter to select files for backup by their kind, or category group. (For details about the kinds of database files that you can select, see the DbFile class kind property or "DbFile Class Constants", earlier in this chapter.)

You can select multiple file kinds in a single call, by summing the kind constant values. For example, to select user schema files, environmental files, and user data files, you could pass the following value for the fileKinds parameter:

DbFile.Kind_Environmental + DbFile.Kind_User_Schema + DbFile.Kind_User_Data

The code fragment in the following example shows the use of the getDbFiles method.

// Obtain an array of references to user data and environmental files
create dbfiles transient;
self.dba.getDbFiles(DbFile.Kind_User_Data + DbFile.Kind_Environmental,
               dbfiles);
foreach dbFile in dbfiles do
// Since we have enumerated environmental files, we must exclude files
// whose excludeFromBackup attribute is set; for example, _environ.dat
    if not dbFile.excludeFromBackup then
    dbFile.backupFile(null,        // Use default directory
                      true,        // Verify during backup
                      true,        // Request data compression
                      false);      // Disallow overwrite of existing files
    endif;
    // Note that the backupCancelled attribute can be set (using a call
    // to cancelBackup) only when this method is executed asynchronously
    if self.backupCancelled then
        break;
    endif;
endforeach;