TABLE6–1 JNDILookups and Their Associated References
JNDILookupName AssociatedReference
java:comp/env Applicationenvironment entries
java:comp/env/jdbc JDBCDataSource resource manager connection factories
java:comp/env/ejb EJBReferences
java:comp/UserTransaction UserTransactionreferences
java:comp/env/mail JavaMailSession Connection Factories
java:comp/env/url URLConnection Factories
java:comp/env/jms JMSConnection Factories and Destinations
java:comp/ORB ORBinstance shared across application components
UsingCustom Resources
Acustom resource accesses a local JNDI repository and an external resource accesses an
externalJNDI repository. Both types of resources need user-specied factory class elements,
JNDIname attributes, etc. In this section, we will discuss how to congure JNDI connection
factoryresources, for J2EE resources, and how to access these resources.
Withinthe Enterprise Server, you can create, delete, and list resources, as well as
list-jndi-entities.
UsingEx ternal JNDI Repositoriesand Resources
Oftenapplications running on the Enterprise Server require access to resources stored in an
externalJNDI repository. For example, generic Java objects could be stored in an LDAP server
asper the Java schema. External JNDI resource elements let users congure such external
resourcerepositories. The external JNDI factory must implement
javax.naming.spi.InitialContextFactoryinterface.
Anexample of the use of an external JNDI resource is:
<resources>
<!-- external-jndi-resource element specifies how to access J2EE resources
-- stored in an external JNDI repository. The following example
-- illustrates how to access a java object stored in LDAP.
-- factory-class element specifies the JNDI InitialContext factory that
-- needs to be used to access the resource factory. property element
-- corresponds to the environment applicable to the external JNDI context
UsingExternalJNDI Repositories and Resources
Chapter6 • JNDI Resources 79