db4o gives you a simple and straightforward interface to object persistence -
Java:
ObjectContainer container = Db4o.openFile(filename);
filename is the path to the file, in which you want to store your objects. Normally you should open an ObjectContainer when the application starts and close it, when the session is finished to persist the changes to a physical storage location:
Java:
container.close();
nly the first call against a file can be successful. Subsequent calls that request to open a database file that is already open will get a DatabaseFileLockedException.
objectContainer.store(object)
Deletion is done with the following method:
Java:
container.delete(object)
Through ObjectContainer#get and ObjectContainer#query you get access to objects retrieval functionality.
The characteristic features of an Object Container are:
Basically Object Container supplies functionality, which is enough for the most common usage of db4o database.
Additional db4o features are provided by an interface extending Object Container - ExtObjectContainer/IExtObjectContainer.
The idea of splitting basic and advanced functionality between 2 interfaces is:
Every Object Container object is also an ExtObjectContainer. You can cast it to ExtObjectContainer or you can use