Download the JDK
Search the Tutorials
Hide the TOC
Trail: Java Naming and Directory Interface(TM).
Lesson: Advanced Topics for LDAP Users
Advanced Topics for LDAP Users
LDAP v3
JNDI as an LDAP API
How LDAP Operations Map to JNDI APIs
How LDAP Error Codes Map to JNDI Exceptions
Security
Modes of Authenticating to LDAP
Authentication Mechanisms
Anonymous
Simple
SASL
Digest-MD5
SSL and Custom Sockets
More LDAP Operations
LDAP Compare
Search Results
LDAP Unsolicited Notifications
Connection Management
Creation
Closing
Pooling
Configuration
Frequently Asked Questions
Home Page > Java Naming and Directory Interface(TM). > Advanced Topics for LDAP Users
Connection Management

> JNDI provides a high-level interface for accessing naming and directory services. The mapping between a JNDI `Context` instance and an underlying network connection might not be one-to-one. The service provider is free to share and reuse connections as long as the interface semantics are preserved. The application developer usually does not need to know the details of how `Context` instances create and use connections. These details are useful when the developer needs to tune his program.

> This lesson describes how the LDAP service provider uses connections. It describes when connections are created and how to specify special connection parameters, such as multiple servers and connection timeouts. This lesson also shows how to dynamically discover and use LDAP servers in network environments that support it.

> A connection that is created must eventually be closed. This lesson contains a section that describes connection closures by the client and the server.

> Finally, this lesson shows you how to use connection pooling to make applications that use many short-lived connections more efficient.

> > Note: Information presented in this lesson are specific to Sun's LDAP service provider. LDAP service providers from other vendors might not use the same policies for managing connections.

Previous page: LDAP Unsolicited Notifications
Next page: Creation