The resource reference name is the logical name of a resource in a JNDI lookup call. The six types of resource objects are: References to these resource objects should be entered in a subcontext of the enterprise bean's environment context (java:comp/env). (These contexts are in the JNDI namespace.)

A DataSource reference should be in the jdbc subcontext. A JavaMail Session reference should be in the mail subcontext. A URL reference should be in the url subcontext. The Queue and Topic Connection Factory references should be in the jms subcontext. A ConnectionFactory should be in the env subcontext. For example, a database name may be declared with:

   private String dbName = "java:comp/env/jdbc/AccountDB";
The java:comp/env/ prefix is the JNDI context for the component.

When entering this reference in the Coded Name column, type:

   jdbc/AccountDB
Similarly, prepend references to JavaMail connections with mail/, URL connections with url/, Queue and Topic connections with jms/, and ConnectionFactory references with env/.