The Apache DB Project
ObJectRelationalBridge

OJB

Downloads

Documentation

Development

Translated (Web)

ojb configuration

OJB provides two different configuration mechanisms:

  1. An XML based repository.xml is used to define the Object/Relational Mapping. This Mapping is translated into a metadata dictionary at runtime. The metadata layer may also be manipulated at runtime through OJB API calls. Follow this link to learn more about the XML repository.
  2. A properties file OJB.properties that is responsible for the configuration of the OJB runtime environment. It contains information that does not change at runtime and does not contain O/R mapping related information.

The rest of this document details on this properties file.

the OJB.properties file

By default this file is named OJB.properties and is loaded from the classpath by a J2EE compliant resource lookup:

Thread.currentThread().getContextClassLoader().getResource(getFilename());
	

The filename of the properties file can be changed by setting a Java system property. This can be done programmatically:

System.setProperty("OJB.properties","myOwnPropertiesFile.props");
	

or by setting a -D option to the JVM:

java -DOJB.properties=myOwnPropertiesFile.props my.own.ojb.Application
	

All things that can be configured by OJB.properties are commented in the file itself. Have a look at the default version of this file.


Copyright © 1999-2003, Apache Software Foundation