Show TOC Start of Content Area

Background documentation Java Data Objects (JDO)  Locate the document in its SAP Library structure

Overview

The aim of the JDO (Java Data Objects) standard is to provide transparent object persistence for Java. It enables application programmers to manipulate persistent data, which is typically stored in relational databases, by means of plain instances of Java classes. The intention is that instances of most user-written Java classes may by persisted with JDO. The object model of JDO is very close to the Java object model and supports most Java language constructs (object references, inheritance, interfaces, collections, arrays and so on) in a transparent and natural way, thereby separating the business from the persistence logic.

The JDO standard supports various data stores. Furthermore, it is applicable in both two- and multi-tier environments. Though strongly related to Java 2 Enterprise Edition, JDO is not part of J2EE. It can be used in a variety of implementation scenarios, not only in J2EE applications.

The standard is supported in the J2EE Engine.

Features

JDO is just one of the possibilities for persisting objects in Java. Other options include using the Java built-in object serialization, the Java Database Connectivity (JDBC) standard, or entity Enterprise Java Beans.

One of the main advantages when using the JDO is that it is not restricted to a single type of a data store. The standard supports both relational and object-oriented databases, as well as any other Enterprise Information Systems (EIS). In a managed environment (such as the SAP Web Application Server), the server-side JDO implementation connects to the data store using a resource adapter that is compliant with the J2EE Connector Architecture.

JDO is a convenient alternative to the Enterprise JavaBeans with container-managed persistence (CMP beans), since it enables clean coding of the persistence logic. The JDO API can be used in any J2EE application component: JSP, servlet, or entity EJB with bean-managed persistence.

The usage of JDO does not replace the usage of JDBC. Rather, the implementation of the JDO standard for a relational database typically uses a JDBC driver to connect to the data store. However, with JDO you do not need to include the SQL statements in your code, which makes it easier to write and maintain.

The JDO Enhancer makes using JDO even easier. You do not have to explicitly implement the javax.jdo.PersistenceCapable interface that enables an object to be stored in persistent storage. At compilation, the bytecode enhancer includes the necessary methods in the relevant classes. The persistence attributes of a class are defined outside the Java code in XML format.

Furthermore, JDO supports dynamic queries using the JDO Query Language (JDOQL).

JDO @ SAP

The SAP implementation of JDO is based on a relational database as a data store. It uses JDBC within the Open SQL for the Java framework to connect to the data store, and defines a specific object-relational mapping to ensure no data is lost when reading persisted data from the database.

The J2EE Engine provides a managed environment for the JDO with an EJB Container and J2EE Connector Architecture implementation.

References

You can read more about the JDO standard on the following Web site:

Link to external website http://java.sun.com/products/jdo/

 

See also:

Getting Started with JDO

Architecture Overview

Persistence Capable Classes

JDO Lifecycle and State Transitions

JDO Enhancement

JDO Metadata

Mapping Persistent Classes to Database Tables

The JDO Query Language

Working with Persistent Objects

Transactions in JDO

Locking

JDO Programming Models

Combining JDO and JDBC

 

End of Content Area