Using JNDI with J2EE RI

As far as this book is concerned the role of JNDI is to support access to the different components of your application. Your J2EE vendor will provide a name service that you can use with each component technology (EJBs, servlets, JSPs and application clients).

This section will concentrate on registering and using named objects within a J2EE application. Later sections will discuss using JNDI as a Java technology outside of a J2EE server.

In simple terms JNDI has two roles within a J2EE server:

  1. To bind distributed objects such as EJBs, JDBC datasources, URLs, JMS resources, and so on.

  2. To look up and use bound objects.

The following sections provide a simple introduction to these two roles.

Binding J2EE Components

The binding ...

Get Sams Teach Yourself J2EE™ in 21 Days, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.