Modernization Hub

JNDI - Java Naming and Directory Interface

Enhanced Definition

JNDI (Java Naming and Directory Interface) is a standard Java API that provides a unified interface for Java applications to access various naming and directory services. In the z/OS context, it enables Java applications (e.g., those running in WebSphere Application Server for z/OS, Liberty for z/OS, or standalone Java batch) to look up and retrieve enterprise resources like DB2 data sources, IBM MQ connection factories, CICS EJB home interfaces, or other configured objects by their logical names.

Key Characteristics

    • Standard Java API: Part of the Java SE and Java EE platforms, providing a consistent way to interact with naming and directory services.
    • Service Provider Interface (SPI): JNDI includes an SPI that allows different naming and directory service implementations (e.g., LDAP, DNS, RMI, COS Naming, file systems) to be plugged in.
    • Resource Abstraction: Decouples application code from the physical location and configuration details of resources, allowing resources to be managed centrally.
    • Logical Naming: Resources are accessed using logical names (e.g., java:comp/env/jdbc/DB2DS), which promotes portability and simplifies configuration changes.
    • Hierarchical Structure: Naming services often present resources in a hierarchical tree structure, similar to a file system, allowing for organized lookups.
    • Mainframe Relevance: Crucial for Java applications on z/OS to interact with traditional mainframe resources and services, often facilitated by application servers like WebSphere for z/OS.

Use Cases

    • DB2 Data Source Lookup: A Java application running on z/OS (e.g., a batch job or a servlet in WebSphere for z/OS) uses JNDI to look up a pre-configured javax.sql.DataSource object to connect to a DB2 for z/OS subsystem.
    • IBM MQ Connection Factory: A Java Message Service (JMS) application on z/OS retrieves an MQConnectionFactory object via JNDI to establish connections to an IBM MQ for z/OS queue manager.
    • CICS EJB Access: A Java EE application deployed in WebSphere for z/OS uses JNDI to locate the home interface of an Enterprise JavaBean (EJB) deployed within CICS Transaction Server for z/OS.
    • Enterprise Bean (EJB) Lookup: Java EE applications running on WebSphere for z/OS use JNDI to find and invoke other EJBs deployed within the same or different application servers.
    • External Directory Integration: A Java application on z/OS might use JNDI to connect to an LDAP directory (e.g., IBM Security Directory Server for z/OS) for user authentication, authorization, or retrieving configuration parameters.

Related Concepts

JNDI is fundamental for Java applications interacting with the z/OS ecosystem. It works hand-in-hand with WebSphere Application Server for z/OS and **Liberty

Related Vendors

IBM

646 products

Tone Software

14 products

Trax Softworks

3 products

Related Categories

Automation

222 products

Operating System

154 products

MQ, Messaging and SOA

76 products

Java and Web

101 products