Data sources

 

+

Search Tips   |   Advanced Search

 

Overview

Installed applications use a data source to access the data from the database.

A data source is associated 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. Application components use the data source to access connection instances to a specific database; a connection pool is associated with each data source.

We can create multiple data sources with different settings, and associate them with the same JDBC provider. One reason to do this is to provide access to different databases.

JDBC providers that are supported by WAS (WAS) are required to implement one or both of the following data source interfaces, which are defined by Sun Microsystems. These interfaces enable the application to run in a single-phase or two-phase transaction protocol.

ConnectionPoolDataSource a data source that supports application participation in local and global transactions, excepting two-phase commit transactions.

In two cases, a connection pool data source does support two-phase commit transactions: when the JDBC provider is DB2 for z/OS Local JDBC provider (RRS), or when the data source is making use of Last Participant support. (Last participant support enables a single one-phase commit resource to participate in a global transaction with one or more two-phase commit resources.) When a connection pool data source is involved in a global transaction, transaction recovery is not provided by the transaction manager. The application is responsible for providing the backup recovery process if multiple resource managers are involved.

XADataSource a data source that supports application participation in any single-phase or two-phase transaction environment. When this data source is involved in a global transaction, the WAS transaction manager provides transaction recovery.

In WAS releases prior to v5.0, the function of data access was provided by a single connection manager (CM) architecture. This connection manager architecture remains available to support J2EE 1.2 applications, but another connection manager architecture is provided, based on the JCA architecture supporting the new J2EE 1.3 application style (also for J2EE 1.4 applications).

These two separate architectures are represented by two types of data sources. To choose the right data source, administrators must understand the nature of their applications, EJB modules, and enterprise beans.

Data source (V4.0) Uses under the original CM architecture. Applications using this data source behave as if they were running in V4.0.
Data source Uses the JCA standard architecture to provide support for J2EE version 1.3 and 1.4 applications. It runs under the JCA connection manager and the relational resource adapter.

 

Choice of data source

  • J2EE 1.2 application - all EJB 1.1 enterprise beans, JDBC applications, or Servlet 2.2 components must use the 4.0 data source.

  • J2EE 1.3 (and subsequent releases) application -

    • EJB 1.1 Module - all EJB 1.x beans must use the 4.0 data source.

    • EJB 2.0 (and subsequent releases) Module - enterprise beans that include container-managed persistence (CMP) V1.x, 2.0, and beyond must use the new data source.

    • JDBC applications and Servlet 2.3+ components - must use the new data source.


 

See Also


Resource adapter
JDBC providers

 

Related Tasks


Access data from application clients
Create and configure a JDBC provider using the administrative console
Create and configure a data source using the administrative console
Configure a JDBC provider using scripting
Configure new data sources using scripting
Configure new WAS40 data sources using scripting
Create and configure a JDBC provider and data source using the Java Management Extensions API
Configure data access for application clients using the assembly tool and ACRCT
Create or change a resource reference using the assembly tool
Assemble data access applications using the assembly tool
Deploy data access applications
Develop data access applications
Create a data source for a clustered environment
Migrate a V4.0 data access application to v6
Create and configure a JDBC provider and data source