Chapter 2. Why JDO?

Java developers who need to store and retrieve persistent data already have several options available to them: serialization, JDBC, object-relational mapping tools, object databases, and entity EJBs. Why introduce yet another persistence framework? The answer to this question is that each of the aforementioned persistence solutions has severe limitations. JDO attempts to overcome these limitations, as illustrated by the table below.

Table 2.1. Persistence Mechanisms

Supports:SerializationJDBCO-R ToolObject DBEJBJDO
Java ObjectsYesNoYesYesYesYes
Advanced OO ConceptsYesNoYesYesNoYes
Transactional IntegrityNoYesYesYesYesYes
Large Data SetsNoYesYesYesYesYes
Existing SchemaNoYesYesNoYesYes
Strict Standards / PortabilityYesNoNoNoYesYes

JDO combines many of the best features from each of the persistence mechanisms listed above. Creating persistent classes under JDO is as simple as creating serializable classes. JDO supports the large data sets, data consistency, concurrent use, and query capabilities of JDBC. Like object-relational software and object databases, it allows the use of advanced object-oriented concepts such as inheritance. It avoids vendor lock-in by relying on a strict specification like entity EJBs. Also like entity EJBs, JDO does not prescribe any specific back-end data store. JDO implementations might store objects in relational databases, object databases, flat files, or any other persistent storage device.


By default, Kodo JDO stores objects in relational databases using JDBC. It can be customized for use with other data stores.

JDO is not ideal for every application. For many applications, though, it provides an exciting alternative to other persistence mechanisms.