|
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g Release 3 (10.1.3) B14428-01 |
|
![]() Previous |
![]() Next |
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:
"Data Sources" in the Oracle Containers for J2EE Services Guide
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.
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:
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:
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: