Java Naming and Directory Interface

The Java Naming and Directory Interface (JNDI) is a Java API for a directory service that allows Java software clients to discover and look up data and resources (in the form of Java objects) via a name. Like all Java APIs that interface with host systems, JNDI is independent of the underlying implementation. Additionally, it specifies a service provider interface (SPI) that allows directory service implementations to be plugged into the framework.[1] The information looked up via JNDI may be supplied by a server, a flat file, or a database; the choice is up to the implementation used.

Typical uses of JNDI include:

  • connecting a Java application to an external directory service (such as an address database or an LDAP server)
  • allowing a Java Servlet to look up configuration information provided by the hosting web container[2]
  1. ^ "Java SE - Core Technologies - Java Naming and Directory Interface (JNDI)". www.oracle.com. Retrieved 2016-12-17.
  2. ^ "JNDI Resources HOW-TO". Apache Tomcat 7 User Guide. Apache Software Foundation. Retrieved 21 January 2014.