org.apache.derby.database
Interface Database

All Known Subinterfaces:
Database
All Known Implementing Classes:
BasicDatabase

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.

IBM Corp. reserves the right to change, rename, or remove this interface at any time.

See Also:
Factory

Method Summary
 void backup(java.io.File backupDir)
          Backup the database to a backup directory.
 void backup(java.lang.String backupDir)
          Backup the database to a backup directory.
 void backupAndEnableLogArchiveMode(java.io.File backupDir, boolean deleteOnlineArchivedLogFiles)
          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 backupAndEnableLogArchiveMode(java.lang.String backupDir, boolean deleteOnlineArchivedLogFiles)
          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 dropAllJDBCMetaDataSPSes()
          Delete all stored prepared statements that were created for JDBC MetaData queries.
 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

public 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.

dropAllJDBCMetaDataSPSes

public void dropAllJDBCMetaDataSPSes()
                              throws java.sql.SQLException
Delete all stored prepared statements that were created for JDBC MetaData queries.

Throws:
java.sql.SQLException - thrown on error deleting the stored prepared statements, most likely a deadlock or timeout.

backup

public void backup(java.lang.String backupDir)
            throws java.sql.SQLException
Backup the database to a backup directory. See on line 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.
Throws:
java.sql.SQLException - Thrown on error

backup

public void backup(java.io.File backupDir)
            throws java.sql.SQLException
Backup the database to a backup directory. See on line documentation for more detail about how to use this feature.

Parameters:
backupDir - the directory where the database backup should go. This directory will be created if not it does not exist.
Throws:
java.sql.SQLException - Thrown on error

backupAndEnableLogArchiveMode

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

backupAndEnableLogArchiveMode

public void backupAndEnableLogArchiveMode(java.io.File backupDir,
                                          boolean deleteOnlineArchivedLogFiles)
                                   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 not 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.
Throws:
java.sql.SQLException - Thrown on error

disableLogArchiveMode

public 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

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

Please see Cloudscape on line documentation on backup and restore.

Throws:
java.sql.SQLException - Thrown on error

unfreeze

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

Please see Cloudscape on line documentation on backup and restore.

Throws:
java.sql.SQLException - Thrown on error

checkpoint

public 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.

Returns:
Nothing
Throws:
java.sql.SQLException - Thrown on error

getLocale

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


getId

public UUID getId()
Deprecated. No longer supported.

Return the UUID of this database.



Apache Derby V10.0 Engine Documentation - Copyright © 1997,2004 The Apache Software Foundation or its licensors, as applicable.