Interface Database

All Known Subinterfaces:
Database
All Known Implementing Classes:
BasicDatabase, SlaveDatabase

public interface Database
The Database interface provides control over a database (that is, the stored data and the files the data are stored in), operations on the database such as backup and recovery, and all other things that are associated with the database itself.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    backup(String backupDir, boolean wait)
    Backup the database to a backup directory.
    void
    backupAndEnableLogArchiveMode(String backupDir, boolean deleteOnlineArchivedLogFiles, boolean wait)
    Backup the database to a backup directory and enable the log archive mode that will keep the archived log files required for roll-forward from this version backup.
    void
    Checkpoints the database, that is, flushes all dirty data to disk.
    void
    disableLogArchiveMode(boolean deleteOnlineArchivedLogFiles)
    Disables the log archival process, i.e No old log files will be kept around for a roll-forward recovery.
    void
    Freeze the database temporarily so a backup can be taken.
    Deprecated.
    No longer supported.
    Get the Locale for this database.
    boolean
    Tells whether the Database is configured as read-only, or the Database was started in read-only mode.
    void
    Unfreeze the database after a backup has been taken.
  • Field Details

  • Method Details

    • isReadOnly

      boolean isReadOnly()
      Tells whether the Database is configured as read-only, or the Database was started in read-only mode.
      Returns:
      TRUE means the Database is read-only, FALSE means it is not read-only.
    • backup

      void backup(String backupDir, boolean wait) throws SQLException
      Backup the database to a backup directory. See online documentation for more detail about how to use this feature.
      Parameters:
      backupDir - the directory name where the database backup should go. This directory will be created if not it does not exist.
      wait - if true, waits for all the backup blocking operations in progress to finish.
      Throws:
      SQLException - Thrown on error
    • backupAndEnableLogArchiveMode

      void backupAndEnableLogArchiveMode(String backupDir, boolean deleteOnlineArchivedLogFiles, boolean wait) throws SQLException
      Backup the database to a backup directory and enable the log archive mode that will keep the archived log files required for roll-forward from this version backup.
      Parameters:
      backupDir - The directory name where the database backup should go. This directory will be created if it does not exist.
      deleteOnlineArchivedLogFiles - If true deletes online archived log files that exist before this backup; otherwise they will not be deleted. Deletion will occur only after backup is complete.
      wait - if true, waits for all the backup blocking operations in progress to finish.
      Throws:
      SQLException - Thrown on error
    • disableLogArchiveMode

      void disableLogArchiveMode(boolean deleteOnlineArchivedLogFiles) throws SQLException
      Disables the log archival process, i.e No old log files will be kept around for a roll-forward recovery. Only restore that can be performed after disabling log archive mode is version recovery.
      Parameters:
      deleteOnlineArchivedLogFiles - If true deletes all online archived log files that exist before this call immediately; otherwise they will not be deleted.
      Throws:
      SQLException - Thrown on error
    • freeze

      void freeze() throws SQLException
      Freeze the database temporarily so a backup can be taken.

      Please see the Derby documentation on backup and restore.

      Throws:
      SQLException - Thrown on error
    • unfreeze

      void unfreeze() throws SQLException
      Unfreeze the database after a backup has been taken.

      Please see the Derby documentation on backup and restore.

      Throws:
      SQLException - Thrown on error
    • checkpoint

      void checkpoint() throws SQLException
      Checkpoints the database, that is, flushes all dirty data to disk. Records a checkpoint in the transaction log, if there is a log.
      Throws:
      SQLException - Thrown on error
    • getLocale

      Locale getLocale()
      Get the Locale for this database.
    • getId

      UUID getId()
      Deprecated.
      No longer supported.
      Return the UUID of this database.