Examples using the BDB API of Berkeley DB

- The helloworld sample demonstrates a minimal program that uses BDB API of Berkeley DB.
- The shipment sample programs illustrate the use of BDB API of Berkeley DB with a shipment database, a familiar example from classic database texts.

## Running the Sample Programs

To run a sample you must change to the sample directory containing the source files and your classpath must include the current directory (.), and db.jar. See the top-level reference guide for installation instructions.

For example:

    $ cd samples/db/helloworld
    $ javac -g *.java
    $ mkdir tmp
    $ java HelloDatabaseWorld

If a compilation error or exception occurs, check your installation.

The 'tmp' subdirectory is used to store the Berkeley DB environment and database files. If the database files are missing or empty then the sample program will write the sample data; otherwise, it will only read and print the existing data. To force the sample to write the data, delete the 'tmp' subdirectory before running the sample.

If you are interested on examining the database files you can use the supplied standard db_* DB command line utility programs with the database files in the 'tmp' subdirectory.

    $ cd samples/db/helloworld
    $ db_dump -h tmp data.db

Will dump the binary contents of the helloworld data store.

For more information on each sample see the README.txt file in the sample directory and the sample source code.