References are logical names used to locate external resources for enterprise applications. References are defined in the application's deployment descriptor file. At deployment, the references are bound to the JNDI name of the resource in the appserver.
The following types of references are supported:
- EJB references for locating the home interface of an enterprise bean.
- Resource references for locating a connection factory object.
These objects define connections to external resources such as databases and messaging systems. The container makes references available in a JNDI naming subcontext. By convention, references are organized as follows:
- EJB references are made available in the java:comp/env/ejb subcontext.
- Resource references are made available as follows:
- JDBC DataSource references are declared in the java:comp/env/jdbc subcontext.
- JMS connection factories are declared in the java:comp/env/jms subcontext.
- JavaMail connection factories are declared in the java:comp/env/mail subcontext.
- URL connection factories are declared in the java:comp/env/url subcontext.