Oracle9IAS Containers for J2EE Independent Edition Guide - (Configuring Data Sources and Call)

xiaoxiao2021-03-06  42

The data source is configured in OC4J:

1.Application.xml element must indicate the file name and path of the Data-Sources.xml file, namely: General Application.xml file and data-sources .xml files are in J2EE / Home / Config /. So the PATH attribute of element includes only the file name of Data-Sources.xml;

2. Data-Sources.xml file define data source: Class property defines the required defined data source type; location, xa-location, and ejb-location definition JNDI names; Connection-Driver indicates the connection driver. E.g:

2. Program call: context env = new initialContext (); DataSource pool = (DataSource) Env.lookup ("JDBC / MyConnection"); connection conn = pool.getConnection ();

转载请注明原文地址:https://www.9cbs.com/read-77510.html

New Post(0)