Berkeley DB Java Edition
version 1.5.1

com.sleepycat.je.util
Class DbDump

java.lang.Object
  |
  +--com.sleepycat.je.util.DbDump

public class DbDump
extends Object

Dump the contents of a database.

To dump a database to a stream:

   DbDump dump = new DbDump(env, databaseName, outputStream, boolean);
   dump.dump();

Because a DATA=END marker is used to terminate the dump of each database, multiple databases can be dumped and loaded using a single stream. The dump() method leaves the stream positioned after the last line written and the DbLoad.load() method leaves the stream positioned after the last line read.


Constructor Summary
DbDump(Environment env, String dbName, PrintStream outputFile, boolean formatUsingPrintable)
          Create a DbDump object for a specific environment and database.
 
Method Summary
 void dump()
          Perform the dump.
static void main(String[] argv)
          The main used by the DbDump utility.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbDump

public DbDump(Environment env,
              String dbName,
              PrintStream outputFile,
              boolean formatUsingPrintable)
Create a DbDump object for a specific environment and database.

Parameters:
env - The Environment containing the database to dump.

dbName - The name of the database to dump.

outputFile - The output stream to dump the database to.

formatUsingPrintable - true if the dump should use printable characters.

Method Detail

main

public static void main(String[] argv)
                 throws DatabaseException,
                        IOException
The main used by the DbDump utility.

Parameters:
argv - The arguments accepted by the DbDump utility.

usage: DbDump -f output-file -l -p -V
              -s database -h dbEnvHome
       

-f - the file to dump to.
-l - list the databases in the environment.
-p - If characters in either the key or data items are printing characters (as defined by isprint(3)), use printing characters in file to represent them. This option permits users to use standard text editors and tools to modify the contents of databases.
-V - display the version of the JE library.
-s database - the database to dump.
-h dbEnvHome - the directory containing the database environment.

Throws:
DatabaseException - if a failure occurs.
IOException

dump

public void dump()
          throws IOException,
                 DatabaseException
Perform the dump.

Throws:
DatabaseException - if a failure occurs.
IOException

Berkeley DB Java Edition
version 1.5.1

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved.