-
Class Summary
Class |
Description |
MapIndexExample |
This is an example of using map indexes.
|
TableAPIExample |
This file includes a number of examples that demonstrate some of the
features of tables and secondary indexes in Oracle NoSQL Database.
|
Package table Description
The code and scripts in this package demonstrate some of the basic functions
of the Oracle NoSQL Database table API, including creation and use of
secondary indexes.
There are two examples at this time.
The examples are independent of one another and have no dependencies.
Before Running the Table Examples
Start a Store
The examples require a running KVStore instance. The examples themselves
create required tables and indexes. The examples do not clean up the store,
but are designed so that if they are run more than once on the same store,
they still work. A KVLite instance is suitable as a running
store. These instructions assume that a store instance has been started
and uses
hostName to refer to the host name used,
port to
refer to the port, and
storename to refer to the name of the store.
install_dir is used to refer to the location of the Oracle NoSQL
Database installation. Here is an example of how to start KVLite. The
root directory needs to exist before creating the store. The first time
KVLite is started it creates the store. Subsequent restarts will use an
existing store if pointed to a root directory that has a store installed.
java -jar install_dir/lib/kvstore.jar kvlite -host hostName -port port\
-store storeName -root rootDirectoryOfStore
Building and Running Examples
Build the example code
In the directory
install_dir/examples/table:
javac -d . -cp install_dir/lib/kvclient.jar *.java
Run the example code
This only requires the client interface, in kvclient.jar. In the
examples/table directory:
java -cp .:install_dir/lib/kvclient.jar table.TableAPIExample \
-host hostName -port port -store storeName
java -cp .:install_dir/lib/kvclient.jar table.MapIndexExample \
-host hostName -port port -store storeName