Logo Search packages:      
Sourcecode: db4.2 version File versions  Download package

synchronized void com::sleepycat::db::Db::remove ( String  file,
String  database,
int  flags 
) throws DbException, java.io.FileNotFoundException [inline]

The Db.remove method removes the database specified by the file and database parameters. If no database is specified, the underlying file represented by file is removed, incidentally removing all of the databases it contained.

Applications should never remove databases with open Db handles, or in the case of removing a file, when any database in the file has an open handle. For example, some architectures do not permit the removal of files with open system handles. On these architectures, attempts to remove databases currently in use by any thread of control in the system will fail.

The Db.remove method may not be called after calling the Db.open method on any Db handle. If the Db.open method has already been called on a Db handle, close the existing handle and create a new one before calling Db.remove.

The Db handle may not be accessed again after Db.remove is called, regardless of its return.

Environment Variables

If the database was opened within a database environment, the environment variable DB_HOME may be used as the path of the database environment home.

Db.remove is affected by any database directory specified using the DbEnv.setDataDir method, or by setting the "set_data_dir" string in the environment's DB_CONFIG file.

Parameters:
database the database to be removed.
file the physical file which contains the database(s) to be removed.
flags currently unused, and must be set to 0.
Exceptions:
DbException The Db.remove method may fail and throw DbException, encapsulating one of the following non-zero errors: An attempt was made to remove the underlying file and a database in the file was currently open.
IllegalArgumentException The Db.remove method will fail and throw a IllegalArgumentException exception if Db.remove called after Db.open was called; or if an invalid flag value or parameter was specified.
FileNotFoundException If the file or directory does not exist, the Db.remove method will fail and throw a FileNotFoundException exception.

Definition at line 561 of file Db.java.

                                                                                                                               {

        try {
            remove0(file, database, flags);
        } finally {
            cleanup();
        }
    }


Generated by  Doxygen 1.6.0   Back to index