Samples
C/C++
The samples are part of the hamsterdb sources; you can find them in the
directory
samples. For your convenience, they are available for
downloading.
db1.c
Simple example of creating a Database, inserting some items, search for these
items and erase them
db2.c
Uses a Cursor to copy one Database to another; this can also be used to copy an
In-Memory Database into a file Database and vice versa
db3.c
Demonstrates how to use hamsterdb for sorting large amounts of data
db4.c
Demonstrates the use of Record Number Databases; reads a text file from stdin
and creates a Database entry for every word. Then prints all words in the
original order.
db5.c
Demonstrates the use of duplicate items; reads a text file from stdin and
creates a Database entry for every word, even if the word is a duplicate. Then
prints all words in alphabetical order and prints the line number of each
occurrence.
db6.cpp
Same as db1.c, but written in C++
env1.c
Shows how to use Environments; creates two Databases to manage Customers and
Orders
env2.c
Shows how to use Environments; creates two Databases to manage Customers and
Orders, and a third Database with duplicate keys for the 1:n relation.
env3.cpp
Same as env2.c, but written in C++
client1.c
Network client, can connect to server1
server1.c
Network server, can host Databases for client1 and demonstrates the use of the hamsterdb Server API
Java
Db1.java
Simple example of creating a Database, inserting some items, search for these
items and erase them
Env3.java
Shows how to use Environments; creates two Databases to manage Customers and
Orders, and a third Database with duplicate keys for the 1:n relation.
C#
SampleDb1.cs
Simple example of creating a Database, inserting some items, search for these
items and erase them
SampleEnv3.cs
Shows how to use Environments; creates two Databases to manage Customers and
Orders, and a third Database with duplicate keys for the 1:n relation.
Visual Basic.NET
Module1.vb
Simple example of creating a Database, inserting some items, search for these
items and erase them.
Python
db1.py
Simple example of creating a Database, inserting some items, search for these
items and erase them
env1.py
Shows how to use Environments; creates two Databases to manage Customers and
Orders