Entering content frame

Component documentation Java Persistence Locate the document in its SAP Library structure

Purpose

The J2EE Engine provides Java applications with a uniform infrastructure for accessing relational databases. Applications have different requirements regarding the way in which they access a relational database. The J2EE Engine provides solutions that are tailored to these requirements. These solutions consist of various interfaces for defining, displaying, and manipulating persistent data.

Features

Basics

The basics for the integrated interaction of the persistence offerings are:

·        Open SQL for Java, which is the underlying layer for all persistence services at the transition point to the relational database

·        The Java Dictionary, which is where cross-database objects such as tables are defined

·        Logical locks, which you use to isolate applications from each other without having to use database locks

Services

Java persistence provides applications with the following services and added value:

·        Portability

Without having to go into the specifics of each database, applications can automatically be run on all supported databases.

·        Support of Java standards

The J2EE Engine provides the application with implementations of the Java standards for relational database accesses and for transparent object persistence.

·        Efficiency and scalability

Open SQL for Java contains a configurable table buffer and JDBC statement pooling. Both are directly available to the applications.

·        Maintainability

Database accesses are validated as early as possible before they are executed in the database. During operation, the J2EE Engine provides many options for viewing and examining database accesses of an application in detail (SQL trace, for example).

Database Accesses

If applications access data in a relational database directly, you can use one of the following standards:

·        Open SQL/JDBC – it is an implementation of the JDBC standard within the Open SQL for Java framework. JDBC is a programming interface that is used at runtime to dynamically compile SQL statements from application code and send them to the database

·        Open SQL/SQLJ – the implementation of the SQLJ standard within Open SQL for Java enables you to embed SQL statements statically into Java programs. The statements are validated at the time of translation, and converted into an executable format.

You can also use native or vendor SQL with both JDBC and SQLJ to utilize the proprietary features of the databases. The advantages of using Open SQL, however, are that it enables you to develop portable applications. For more information, see Java Persistence Infrastructure.

Object persistence as opposed to relational persistence provides an object-oriented view of persistent data. Application developers do not work with tables and do not manually write SQL statements explicitly by using SQLJ or JDBC. Instead, the application works directly with Java objects that are automatically made persistent. An application developer no longer writes SQL to load the persistent state from the database into the object or to write from the object to the database. J2EE Engine provides implementations of the following standards for object-oriented persistence:

·        Entity enterprise beans – the EJB technology is a component model for distributed, server-side applications, and produces various services in the J2EE architecture. In this model, persistent data is represented by entity beans.

·        Java Data Objects (JDO) – while entity beans are based on the component model of the J2EE architecture, the JDO standard keeps to the object model of the Java programming language. JDO therefore allows you to directly make almost every Java class persistent.

 

See also:

Java Persistence Infrastructure

Tables

Connectivity

Relational Persistence

Object Persistence for Java

Transactions and Resource Handling

Locks

 

Leaving content frame