db4o is the native Java, .NET and Mono open source object database. This documentation and tutorial is intended to get you started with db4o and to be a reliable companion while you develop with db4o. Before you start, please make sure that you have downloaded the latest db4o distribution from the db4objects website.
You are invited to join the db4o community in the public db4o forumsto ask for help at any time. You may also find the db4o knowledgebase helpful for keyword searches.
Java, .NET and Mono db4o is available for Java, for .NET and for Mono. This tutorial was written for Java . The structure of the other distributions may be considerably different, so please use the tutorial for the version that you plan to experiment with first.
The db4oJava distribution comes as one zip file, db4o-5.0-java.zip. When you unzip this file, you get the following directory structure:
db4o-5.0/doc/tutorial/index.html This is the interactive HTML tutorial. Examples can be run "live" against a db4o database from within the browser. In order to use the interactive functionality a Java JRE 1.3 or above needs to be installed and integrated into thebrowser. Java security settings have to allow applets to be run.
db4o-5.0/doc/tutorial/db4o-5.0-tutorial.pdf The PDF version of the tutorial allows best fulltext search capabilities.
db4o-5.0/doc/api/index.html The API documentation for db4o is supplied as JavaDocs HTML files. While you read through this tutorial it may be helpful to look into the API documentation occasionaly.
PDF byiText, generated by Doctor, courtesy of db4objects Inc.
1. First Glance
Before diving straight into the first source code samples let's get you familiar with some basics. 1.1. The db4o engine... The db4o object database engine consists of one single jar file. This is all that you need to program against. The versions supplied with the distribution can be found in /db4o-5.0/lib/.db4o-5.0-java1.1.jar will run with most Java JDKs that supply JDK 1.1.x functionality such as reflection and Exception handling. That includes many IBM J9 configurations, Symbian and Savaje. db4o-5.0-java1.2.jar is built for all Java JDKs between 1.2 and 1.4. db4o-5.0-java5.jar is built for Java JDK 5. 1.2. Installation If you add one of the above db4o-*.jar files to your CLASSPATH db4o is installed. In case youwork with an integrated development environment like Eclipse (We really recommend Eclipse, it's also free.) you would copy the db4o-*.jar to a /lib/ folder under your project and add db4o to your project as a library. (You only need to copy the one jar file for the distribution you are targeting.)
Here is how to add the db4o library to an Eclipse project - create a folder named "lib" under yourproject directory, if it doesn't exist yet - copy db4o-*.jar to this folder - Right-click on your project in the Package Explorer and choose "refresh" - Right-click on your project in the Package Explorer again and choose "properties" - select "Java Build Path" in the treeview on the left - select the "Libraries" tabpage. - click "Add Jar" - the "lib" folder should appear below your project -choose db4o-*.jar in this folder - hit OK twice
1.3. db4o Object Manager
db4o Object Manager is a GUI tool to browse and query the contents of any db4o database file. Object Manager has to be downloaded seperately from the main db4o distributions. Please visit the db4o Download Center and choose the installation appropriate for your system. The following distributions are currently available:PDF by iText, generated by Doctor, courtesy of db4objects Inc.
- db4o ObjectManager for Windows IKVM (Java VM included) - db4o ObjectManager for Windows no Java VM - db4o ObjectManager for Linux
PDF by iText, generated by Doctor, courtesy of db4objects Inc.
1.4. API Overview Do not forget the API documentation while reading through this tutorial. It provides an organized view of the...
Leer documento completo
Regístrate para leer el documento completo.