DatabaseEntry foundData = new DatabaseEntry();
DatabaseConfig dbConfig = new DatabaseConfig();
dbConfig.setReadOnly(true);
DbInternal.setUseExistingConfig(dbConfig, true);
Database db = env.openDatabase(null, dbName, dbConfig);
dupSort = db.getConfig().getSortedDuplicates();
printHeader(outputFile, dupSort, formatUsingPrintable);
Cursor cursor = db.openCursor(null, null);
while (cursor.getNext(foundKey, foundData, LockMode.DEFAULT) ==
OperationStatus.SUCCESS) {
dumpOne(outputFile, foundKey.getData(), formatUsingPrintable);
dumpOne(outputFile, foundData.getData(), formatUsingPrintable);
}
cursor.close();
db.close();
outputFile.println("DATA=END");
Tracer.trace(Level.INFO, DbInternal.envGetEnvironmentImpl(env),
"DbDump.dump of " + dbName + " ending");
}