Assembling data access applications

A data access application uses a data source to access data from a database.

 

Before you begin

This article assumes that you have created an enterprise application that has an EJB module and that you want this application to access one or more resources.

 

Overview

To access a resource, you associate a data source with a JDBC provider that supplies the specific JDBC driver implementation class. The data source represents the J2EE Connector Architecture (JCA) connection factory for the relational resource adapter.

We can create multiple data sources associated with the same JDBC provider. Each JDBC provider supports the ConnectionPoolDataSource or XADataSource interfaces. These interfaces enable the application to run in a single-phase or two-phase transaction protocol.

This article describes how to configure resource references for an application so the application can access resources using an assembly tool such as the Application Server Toolkit (AST) or Rational Web Developer.

 

Procedure

  1. Start an assembly tool.

  2. If you have not done so already, configure the assembly tool for work on J2EE modules. Ensure that the J2EE capability is enabled.

  3. Define the resource reference attributes.

  4. Bind this resource reference to a resource like a data source.

  5. Configure isolation level, access intent assembly settings.

    1. Right-click your EJB module in a Project Explorer view and click Open With > Deployment Descriptor Editor.

    2. In an EJB Deployment Descriptor editor, select the Access tab.

    3. Under Isolation Level, click Add.

    4. Select the isolation level, enterprise beans, and method elements. For information on isolation levels, press F1.

    5. Click Finish.

  6. Map enterprise beans to database tables.

 

Result

Files for the updated application are shown in the Project Explorer view.

 

What to do next

After testing your application, one can deploy your application to an application server.

 

See also


Migrating a V4.0 data access application to v6

 

See Also


Data sources

 

See Also


Data access : Resources for learning

 



 

 

Rational is a trademark of the IBM Corporation in the United States, other countries, or both.