(.*)\<\/title\>/si', file_get_contents(__FILE__), $result); $pageTitle = trim($result[1]); $pageURL = "http" . ((!empty($_SERVER['HTTPS'])) ? "s" : "") . "://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; ?>

Java Data Objects (JDO)

The Java Data Objects (JDO) specification is part of the Sun Java Community Process. JDO is a Java application program interface (API) for transparent persistence. It works with both object and relational databases as well as other types of systems. It is designed to also work well with EJB and J2EE.

The JDO object model is determined by a set of Java classes and XML metadata file. The metadata file contains modeling directives that either override the semantics specified in Java or provides semantics that cannot be expressed in Java. An enhancer is provided that enhances the Java classes based on these modeling directives.

The JDO specification provides a standard interface for accessing, storing, and processing persistent objects. The primary aspects in the JDO model are:

  • PersistenceManager: PersistenceManagers negotiate accesses, transactions, and queries between applications and the underlying data store. More on the JDO PersistenceManager.
  • Transaction: Transactions provide for atomic, consistent, isolated, and durable management of data (ACID properties). More on ACID properties.
  • Query: The JDO Query Language (JDOQL) allows users to search for persistent objects matching specific criteria. JDOQL is meant to be query language neutral so that the underlying query language could be SQL, an object database query language such as OQL, or a specialize API to a hierarchical database or EIS system. More on the JDO Query Language.
  • PersistenceCapable classes: The actual entities that are stored and fetched. There are three identity models to allow for different underlying database management systems. More on JDO identity models.

The JDO specification uses the Java  language as much as possible, which allows the transparent integration of Java. This is illustrated by the following diagram and contrasts with the database sublanguage of SQL and its variants. In this diagram, you only see the host programming language and no database sublanguage or call-level interface as in JDBC.

Transparent integration of programming languages and database access

An example of a host statement in Java that creates a new Person instance would be:

person = new Person();
person.ssan = "999999999";
person.name = "Doug Barry";

This code fragment would be all the code necessary to create a new person. There is no database sublanguage or call interface. If you wanted to manipulate this object in Java, you could use the object directly. Also see transparent persistence vs. JDBC call-level interface.

For more information on transparent persistence, see:

For examples of JDO code, see

>>
For an architectural example of how JDO can be used, see Using JDO with Application Servers.
>>
For more details, see the JDO Specification Sun site.

Related Articles

More detail for the current topic:

More on the general topic: DBMS Standards

You may use this material for your work or classes. Reprint Policy. Be sure to check the menu at the left for other articles available on this site.

The Savvy Manager's Guide

Douglas K Barry is also the author of a book that explains Web Services, service-oriented architecture, and Cloud Computing in an easy-to-understand, non-technical manner.

Web Services, Service-Oriented Architectures, and Cloud Computing: The Savvy Manager's Guide

Web Services, Service-Oriented Architectures, and Cloud Computing: The Savvy Manager's Guide (Second Edition)

by with David Dick

This is a guide for the savvy manager who wants to capitalize on the wave of change that is occurring with Web Services, service-oriented architecture, and—more recently—Cloud Computing. The changes wrought by these technologies will require both a basic grasp of the technologies and an effective way to deal with how these changes will affect the people who build and use the systems in our organizations. This book covers both issues. Managers at all levels of all organizations must be aware of both the changes that we are now seeing and ways to deal with issues created by those changes.