This document will guide you through the very first steps of setting up a project with OJB. To make this easier, OJB comes with a blank project template called ojb-blank which you’re encouraged to use. You can download it here. For the purpose of this guide, we’ll be showing you how to setup the project for a simple application that handles products and uses MySQL. This is continued later on in the next tutorial parts.

First off, OJB uses Ant to build, so please install it prior to using OJB. In addition, please make sure that the environment variables ANT_HOME and JAVA_HOME are correctly set to the top-level folders of your Ant distribution and your JDK installation, respectively. Next download the latest ojb-blank and OJB binary distributions. You can also start with the source distribution rather than the binary as the unit tests provide excellent sample code and you can build the ojb-blank project on your own with it.

The ojb-blank project contains all libraries necessary to get running. However, there may be additional libraries required when you venture deeper into OJB’s APIs. See here for a list of additional libraries. Most notably, you’ll probably want to add the jdbc driver for you database unless you plan to use the embedded Hsqldb database for which the ojb-blank project is pre-configured (including all necessary jars).

Download pdf Getting Start OJB