Data sources

 

An application uses 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.

One can create multiple data sources associated with the same JDBC provider. Each JDBC provider supports the interfaces defined by Sun Microsystems listed below. 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 all transactions, including two-phase commit transactions. When this kind of 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 a single-phase or a global (two-phase) transaction environment. When this data source is involved in a global transaction, the transaction manager provides transaction recovery.

Previously, 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 a new connection manager architecture is provided, based on the JCA architecture supporting the new J2EE 1.3 application style.

These two separate CM 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 - this data source uses the JCA standard architecture to provide J2EE 1.3 support. It runs under the JCA connection manager and the relational resource adapter. Applications using this type of data source might behave differently because of the J2EE 1.3 architecture.

 

Choice of data source

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

  • J2EE 1.3 application -

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

    • EJB 2.0 Module - enterprise beans that include CMP Version 2.0 and 1.x must use the new data source.

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


Resource adapter
JDBC providers
Accessing data from application clients
Creating and configuring a data source using the administrative console
Creating and configuring a JDBC provider using the administrative console
Creating and configuring a JDBC provider and data source using the JMX API
Configure data access for application clients
Creating or changing a resource reference
Assembling data access applications
Deploying data access applications
Developing data access applications
Creating a JDBC driver on multiple nodes
Creating and configuring a JDBC provider and data source