The JNDI API

Using JNDI, all naming service lookups are performed using a context. On connection to the naming service, an 'initial context' is provied. Using this intial context, we can gain access to other contexts in the namespace by performing a lookup for the context. A general lookup operation is provided to find and retrieve a resource in one step.

The classes in the JNDI API reflect this approach to resource access. Five packages provide the classes used in JNDI. These packages are described in Table 12-1.

Table 12-1. JNDI Classes
PackageDescription
javax.namingThe main package for the API. Contains the classes for connecting to naming services and performing lookup operations for resources.
javax.naming.directoryAdds functionality for accessing ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.