Web applications allow you to use logical names for JNDI lookups in your servlet and JSP code. Logical names allow your application to run in environments where the JNDI name space does not match the names hard coded in your application. When deploying an application, you can map the logical names to actual names that match the server’s configuration.
When developing an application, you must use JNDI to obtain database connections, mail sessions, and EJB proxies. You must catalog the JNDI names used by your code in the application’s deployment descriptor.
All logical JNDI names used in your application must be prefixed with java:comp/env. The J2EE specification requires the following hierarchy, based on resource type:
java:comp/env/ejb for EJB references
java:comp/env/jdbc for JDBC javax.sql.DataSource references
java:comp/env/mail for JavaMail session references
java:com/env/url for java.net.URL references
java:com/env/jms for javax.jms references
Copyright © 2005. Sybase Inc. All rights reserved. |