A resource reference is an element in a deployment descriptor that identifies the component’s coded name for the resource. For example, jdbc/SavingsAccountDB. More specifically, the coded name references a connection factory for the resource.
The JNDI name of a resource and the resource reference name are not the same. This approach to naming requires that you map the two names before deployment, but it also decouples components from resources. Because of this decoupling, if at a later time the component needs to access a different resource, the name does not need to change. This flexibility makes it easier for you to assemble J2EE applications from preexisting components.
The following table lists JNDI lookups and their associated resource references for the J2EE resources used by the Enterprise Server.
Table 20–1 JNDI Lookup Names and Their Associated References
JNDI Lookup Name |
Associated Resource Reference |
---|---|
java:comp/env |
Application environment entries |
java:comp/env/jdbc |
JDBC DataSource resource manager connection factories |
java:comp/env/ejb |
EJB References |
java:comp/UserTransaction |
UserTransaction references |
java:comp/env/mail |
JavaMail Session Connection Factories |
java:comp/env/url |
URL Connection Factories |
java:comp/env/jms |
JMS Connection Factories and Destinations |
java:comp/ORB |
ORB instance shared across application components |