This topic applies to .NET version only
One of the most widely used platform independent formats of data exchange today is xml.
Db4o does not provide any specific API to be used for XML import/export, but with the variety of XML serialization tools available for Java and .NET (freeware and licensed) this is not really necessary.
All that you need to export your database/query results is:
Import process is just the reverse:
Let's go through a simple example. We will use .NET XmlSerializer. (You can use any other XML serialization tool, which is able to serialize/deserialize classes).
First, let's prepare a database:
We will save the database to XML file "formula1.xml":
After the method executes all car objects from the database will be stored in the export file as an array. Note that child objects (Pilot) are stored as well without any additional settings. You can check the created XML file to see how it looks like.
Now we can clean the database and try to recreate it from the XML file:
Easy, isn't it? Obviously there is much more about XML serialization: renaming fields, storing collections, selective persistence etc. You should be able to find detailed description together with the serialization library, which you will use.