org.apache.derby.database
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:
Factory

Method Summary
 void backup(java.lang.String backupDir, boolean wait)
          Backup the database to a backup directory.
 void backupAndEnableLogArchiveMode(java.lang.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 checkpoint()
          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()
          Freeze the database temporarily so a backup can be taken.
 UUID getId()
          Deprecated. No longer supported.
 java.util.Locale getLocale()
          Get the Locale for this database.
 boolean isReadOnly()
          Tells whether the Database is configured as read-only, or the Database was started in read-only mode.
 void unfreeze()
          Unfreeze the database after a backup has been taken.
 

Method Detail

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(java.lang.String backupDir,
            boolean wait)
            throws java.sql.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:
java.sql.SQLException - Thrown on error

backupAndEnableLogArchiveMode

void backupAndEnableLogArchiveMode(java.lang.String backupDir,
                                   boolean deleteOnlineArchivedLogFiles,
                                   boolean wait)
                                   throws java.sql.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:
java.sql.SQLException - Thrown on error

disableLogArchiveMode

void disableLogArchiveMode(boolean deleteOnlineArchivedLogFiles)
                           throws java.sql.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:
java.sql.SQLException - Thrown on error

freeze

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

Please see the Derby documentation on backup and restore.

Throws:
java.sql.SQLException - Thrown on error

unfreeze

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

Please see the Derby documentation on backup and restore.

Throws:
java.sql.SQLException - Thrown on error

checkpoint

void checkpoint()
                throws java.sql.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:
java.sql.SQLException - Thrown on error

getLocale

java.util.Locale getLocale()
Get the Locale for this database.


getId

UUID getId()
Deprecated. No longer supported.

Return the UUID of this database.


Built on Thu 2010-12-23 20:49:13+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.