Skip Headers
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g Release 3 (10.1.3)
B14428-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

Understanding EJB Data Source Services

A data source is a Java object that represents the physical enterprise information system to which OC4J persists entities. Your application uses a data source object to retrieve a connection to the enterprise information system the data source represents.

This section describes:

For more information, see:

What Types of Data Source does OC4J Support?

OC4J supports the following types of data source:

  • Managed: a managed data source is an OC4J-provided implementation of the java.sql.DataSource interface that acts as a wrapper for a JDBC driver or data source.

  • Native: a native data source is a JDBC vendor-provided implementation of the java.sql.DataSource interface.

Table 2-5 lists the characteristics of these OC4J data sources.

Table 2-5 OC4J Data Source Type Characteristics

Characteristic Managed Native

Uses OC4J connection pool?

Yes

No

Connections can participate in global transactions?

Yes

No

Connections wrapped with an OC4J Connection proxy?

Yes

No


Where Do You Configure Data Source Information in OC4J?

In OC4J, you configure data source information in a data-sources.xml file.

You can include a data-sources.xml file in your EAR but OC4J does not support multiple data-sources.xml files.

For more information, see:

What is a Default Data Source?

To simplify application configuration, you can define default data sources.

How you define a default data source depends on the type of application you want to access the default data source from:

How Does OC4J Handle Multiple Data Sources?

OC4J does not support multiple data sources within different entities in orion-ejb-jar.xml.

If your application is composed of more than one EAR and each EAR contains a data-sources.xml, then, when you deploy your application, OC4J will use the last entity bean's data-source.xml for all entity beans.

To accomodate this scenario, specify the data source in orion-application.xml or specify a default data source.

For more information, see: