Data sources
Applications data sources to obtain connections to relational databases. A data source is analogous to the Java EE Connector Architecture (JCA) connection factory, which provides connectivity to enterprise information systems (EIS).
A data source is associated with a JDBC provider, which supplies the driver implementation classes required for JDBC connectivity with the vendor database. Application components transact directly with the data source to obtain connection instances to the database. The connection pool that corresponds to each data source provides connection management.
Create multiple data sources with different settings, and associate them with the same JDBC provider. For example, we might use multiple data sources to access different databases within the same vendor database application. WAS requires JDBC providers to implement one or both of the following data source interfaces. These interfaces enable the application to run in a single-phase or two-phase transaction protocol.
ConnectionPoolDataSource Supports application participation in local and global transactions, excepting two-phase commit transactions. Transaction recovery is provided by the application if multiple resource managers are involved. See topic about using one-phase and two-phase commit resources in the same transaction.
XADataSource Supports application participation in any single-phase or two-phase transaction environment. The transaction manager provides transaction recovery. Can use container manager.
Data sources:
Data source (WAS V4) (deprecated) Utilizes the original CM architecture. Applications using this data source behave as if they were running in Version 4.0. Data source Uses the JCA standard architecture to provide support for J2EE version 1.3 and 1.4, as well as Java EE applications. It utilizes 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 (deprecated).
- 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 - enterprise beans that include container-managed persistence (CMP) Version 1.x, 2.0, and beyond must use the new data source.
- JDBC applications and Servlet 2.3+ components - must use the new data source.
Related:
- Relational resource adapters and JCA
- JDBC providers
- Access data from application clients
- Configure a JDBC provider
- Configure a data source
- Configure a JDBC provider using wsadmin
- Configure new data sources using wsadmin
- Configure new WAS40 data sources using wsadmin.sh (deprecated)
- Create and configure a JDBC provider and data source using the JMX API
- Create or change a resource reference using the assembly tool
- Assemble data access (EJB) applications using the assembly tool
- Deploy data access (EJB) applications
- Developing data access applications
- Configure a JDBC provider for a clustered environment
- Migrate applications to use data sources of the current Java EE Connector Architecture (JCA)
- Configure a JDBC provider and data source
- Use one-phase and two-phase commit resources in the same transaction
- JDBC data source custom properties