user manual
Chapter 22: Using JDBC 227
Chapter
22
Chapter 22Using JDBC
Datasources are bound into a JNDI service after the JNDI Definitions Module
is deployed. Datasource objects are stored into the Serial Context provider in
the naming service. The portable J2EE mandated way to lookup a datasource
is using a Resource Reference in the individual component's ejb-jar.xml
descriptor file. Refer to the J2EE 1.3 Specification for information on how to
use this element. This Resource Reference is itself a binding to the actual
JNDI name in the Naming Service that is performed as a deployment time
editing step.
In order to fully link the application component to its environment, however,
the logical name for the resource must be resolved to a JNDI name. The
Borland proprietary deployment descriptor, ejb-borland.xml, complements ejb-
jar.xml and provides this mechanism in its own Resource Reference
elements. The contents of this element varies depending upon the application
component type and the resource to which it's trying to connect.
J2EE applications must lookup deployed datasources from the JNDI
environment naming context, that is java:comp/env/... In order to access a
resource from the JNDI environment naming context, you must first deploy a
J2EE application component to an appropriate container with a declared
reference to the required datasource. The procedure for doing so for JDBC
datasources is described here. First, however, we'll explore how to configure
the JDBC datasources to which your application components will connect.
Important For documentation updates, go to www.borland.com/techpubs/bes.










