Operating Systems: i5/OS
             Personalize the table of contents and search results

 

Develop data access applications

 

Data access applications allow you to manipulate data from outside sources for use within your application serving environment.

 

Overview

You can access data in various ways:

 

Procedure

  1. Decide how to implement data access.

    The Enterprise JavaBeans (EJB) programming model provides several distinct server-side component types: entity, session, and message-driven beans, and servlets. Of these types, entity beans are typically used to model business components in an application. Entity beans have both state and behavior.

    The state of entity beans is persistent and is stored in a database. As changes are made to an entity bean, its state is kept in synchronization with the database record representing the bean. There are two types of entity beans provided by the EJB model and these two types differ in the mechanism used to provide persistence. These two types of entity beans are container-managed persistence (CMP) beans and bean-managed persistence (BMP) beans.

    See the Developing enterprise beans article for information on developing entity beans. Tips:

    An alternative to developing entity beans is using the Service Data Objects (SDO) framework, which is a unified framework for data application development. With SDO, you do not need to be familiar with a technology-specific API in order to access and utilize data. You need to know only one API, the SDO API, which lets you work with data from multiple sources, including relational databases, entity EJB components, XML pages, Web services, the Java Connector Architecture, JavaServer Pages, and more.

  2. Look up a data source or connection factory using a resource reference (Looking up data sources with resource references for relational access). Do not perform this step if you work with CMP beans, however; the EJB container handles this process for CMP beans. To run applications on WebSphere Application Server, your code must use resource references to logically named data sources or connection factories. Mapping the resource references to actual resources is usually done at assembly time. The Application Server administrator configures those resources.

  3. Get a connection to a data source or a connection factory. (See the "Getting connections" section of Connection life cycle for details.) Do not perform this step if you work with CMP beans. The EJB container handles this process for CMP beans.

    The connection management architecture for both relational and procedural access to enterprise information systems (EIS) is based on the J2EE Connector Architecture (JCA) specification. The Connection Manager (CM), which pools and manages connections within an application server, is capable of managing connections obtained through both resource adapters (RAs) defined by the JCA specification, and data sources defined by the JDBC Extensions Specification.




}
Extensions to data access APIs

Recreating database tables from the exported table data definition language

CMP bean associated technologies

Manipulating the synchronization of entity beans and datastores

Avoiding ejbStore invocations on non-modified EntityBean instances

The benefits of using resource references

Accessing data using J2EE Connector Architecture connectors

Cursor holdability support for JDBC applications

Data access bean types

Accessing data from application clients

Data access with Service DataObjects

Using the Java Database Connectivity data mediator service for data access

Using the Enterprise JavaBeans data mediator service for data access

Establishing custom finder SQL dynamic enhancement server-wide

Establishing custom finder SQL dynamic enhancement on a set of beans

Establishing custom finder SQL dynamic enhancement for specific custom finders

Disabling custom finder SQL dynamic enhancement for custom finders on a specific bean

Exceptions pertaining to data access

CMP connection factories collection