WAS v8.5 > Develop applications > Develop data access resourcesAssemble data access applications
When you assemble enterprise bean code into files that can be deployed onto an application server, you configure properties that define how the application accesses an enterprise information system (EIS), such as a database.
This topic assumes that we have created an enterprise application containing an EJB module that must transact with a database.
A data access application uses resources, such as data sources or connection factories, to connect with a database.
An application component uses a connection factory to access a connection instance, which the component then uses to connect to the underlying enterprise information system (EIS). Examples of connections include database connections, Java Message Service connections, and SAP R/3 connections.
During application assembly you perform activities that enable the application to use these resources. The process typically requires an assembly tool.
- Identify the logical names used by the EJB module to reference application resources. These logical names are called resource references.
For further explanation, read the topic, The benefits of using resource references.
- Start an assembly tool.
- If we have not done so already, configure the assembly tool for work on Java EE modules. Ensure that Java EE capability is enabled.
- Define mapping and security properties for the resource references. This process includes the following activities:
- Bind the resource references to the application resources that provide database connectivity.
See the topic, Data source lookups for enterprise beans and web modules, for more information on the concept of binding. At deployment time we can alter your bindings if necessary.
- For each resource define an authentication type, which is the security configuration through which database connections are granted. There are two authentication types:
See the topic, J2EE connector security, for detailed reference on resource authentication.
- Component-managed
- The enterprise bean code performs EIS signon for data source or connection factory connections.
- Container-managed
- WAS v8.5 performs EIS signon.
- Configure access intent policy settings for the enterprise beans.
- Right-click custom EJB module in a Project Explorer view and click Open With > Deployment Descriptor Editor.
- In an EJB Deployment Descriptor editor, select the Access tab.
- Under Isolation Level, click Add.
- Select the isolation level, enterprise beans, and method elements. For information on isolation levels, press F1.
- Click Finish.
- Map enterprise beans to database tables.
Results
Files for the updated application are shown in the Project Explorer view.
After testing the application, you are ready to deploy the application to an application server.
Subtopics
- Create or changing a resource reference
A resource reference supports application access to a resource (such as a data source, URL, or mail provider) using a logical name rather than the actual name in the runtime environment. This capability eliminates the necessity to alter application code when we change the resource runtime configurations.- Assemble resource adapter (connector) modules
A resource adapter archive (RAR) file contains code that implements a library for connecting with a backend Enterprise Information System (EIS).- Migrating applications to use data sources of the current JCA
Migrate the applications that use Version 4 data sources, or data sources (WAS V4), to use data sources that support more advanced connection management features, such as connection sharing.- Create or changing a resource reference
A resource reference supports application access to a resource (such as a data source, URL, or mail provider) using a logical name rather than the actual name in the runtime environment. This capability eliminates the necessity to alter application code when we change the resource runtime configurations.- Assemble resource adapter (connector) modules
A resource adapter archive (RAR) file contains code that implements a library for connecting with a backend Enterprise Information System (EIS).
Related concepts:
JDBC providers
Data sources
Development and assembly tools
Resource reference benefits
Data source lookups for enterprise beans and web modules
Java EE connector security
Access intent policies for EJB 2.x entity beans
Related
Install enterprise application files
Assemble EJB modules
Deploy EJB modules
Create or changing a resource reference
Reference:
Data access: Resources for learning
Develop applications that use JNDI
Direct and indirect JNDI lookup methods for data sources
Connection factory JNDI name practices