What is JNDI?

JNDI is a standard Java package that provides a uniform API for accessing a wide range of services. It is somewhat similar to JDBC, which provides uniform access to different relational databases. Just as JDBC lets us write code that doesn’t care whether it’s talking to an Oracle database or a DB2 database, JNDI lets us write code that can access different directory and naming services, including the naming services provided by EJB servers. EJB servers are required to support JNDI by organizing beans into a directory structure and providing a JNDI driver, called a service provider, for accessing that directory structure. Using JNDI, an enterprise can organize its beans, services, data, and other resources in a unified directory.
The Java Naming and Directory Interface (JNDI) is an API for direct that allows clients to discover and lookup data and objects via a name.
The API provides:

  • a mechanism to bind an object to a name
  • a directory lookup interface that allows general queries
  • an event interface that allows clients to determine when directory entries have been modified
  • LDAP extensions to support the additional capabilities of an LDAP service.

The SPI portion allows support for practically any kind of naming or directory service including:

Leave a Reply