1
Copyright (c) 2004 Persistit Corporation. All Rights Reserved.
3
SimpleDemo is a very simple example to demonstrate basic operations of
4
Persistit. This class performs the following operations:
6
- Initializes com.persistit.Persistit using a Properties file.
7
- Creates a com.persistit.Exchange with which to store and fetch
8
data to and from a com.persistit.Tree.
9
- Reads some names from the console and stores records in the <tt>Tree</tt>
10
indexed by those names.
11
- Dispays the names in alphabetical order.
12
- Closes Persistit to ensure all records have been written to disk.
16
Run Ant on build.xml in this directory (target "compile")
20
javac -classpath ../../lib/persistit_jsa110.jar SimpleDemo.java
24
Run Ant on build.xml in this directory (target "run")
28
java -classpath ../../lib/persistit_jsa110.jar;. SimpleDemo
30
To run SimpleDemo without building it first:
32
java -classpath ../../lib/persistit_jsa110.jar;../../lib/examples.jar SimpleDemo
34
Persistit will place a volume file in paths specified by persistit.properties.
35
You can change the location of these files by modifying the datapath property
36
of this configuration file.