Copy the ojb-blank.jar
file to your project directory and unpack it via
the jar xvf ojb-blank.jar
command. This will unpack it into the
ojb-blank
directory under wherever you unpacked it from. You can move things out
of that directory into your project directory, or, more simply, rename the ojb-blank
directory to be whatever you want your project directory to be named.
The ojb-blank project provides the libraries, basic configuration files, and an ant
build file which can be used to get started with OJB. The first thing you will need to
do is edit the build.properties
file to enter your database information. By
default it is set up to work against an embedded HSQLDB instance. This will work fine
for learning, but you will probably want to configure it to run against a different RDBMS for
most projects. For example configurations you can look in the profiles
directory
in the OJB install directory. The build file will copy the properties out of the project's
build.properties
into the repository_database.xml
located in the
src/resources/
directory when the project is built.
If you are not using HSQLDB make sure to copy your JDBC driver into the lib
directory and ensure it is in the classpath used by the build.xml
.
The ojb-blank project also includes the Torque
schema for OJB's required tables. You do not need to use Torque to build your database, but
it can also be used generate the DDL for you to modify an existing database. The OJB tables
are required for specific options, such as clustered locking and OJB managed sequences. More
information on these tables is available platform documentation
The repository metadata files are located in the
src/resources/
directory. The repository_user.xml
file
should be used for describing your specific mappings.