Prev Next

Java / JNDI

1. What is JNDI?

JNDI stands for Java Naming and Directory Interface . JNDI allows distributed applications to look up services in an abstract, resource-independent way. It is an API that provides naming and directory functionality to applications written using Java. It is independent of any specific directory se...

Read full answer

2. List some of the resource that can be looked up using JNDI.

javax.sql.DataSource, javax.jms.Connection-Factory, javax.jms.QueueConnectionFactory, javax.jms.TopicConnectionFactory, javax.mail.Session, java.net.URL, javax.resource.cci.ConnectionFactory.

Read full answer

3. Explain binding and context in JNDI.

The association of a name with an object is called a binding while context is a set of name-to-object bindings. Every context has an associated naming convention. A context provides resource lookup.

Read full answer

4. Is JNDI part of Java SE?

5. List some of the service providers of JNDI.

Lightweight Directory Access Protocol (LDAP), Common Object Request Broker Architecture (CORBA) Common Object Services (COS) name service, Java Remote Method Invocation (RMI) Registry, Domain Name Service (DNS).

Read full answer

6. What is the main package of JNDI API.

javax.naming package.

Read full answer

7. What is JNDI naming service?

A naming service maintains a set of bindings. Bindings maps names to objects. All objects in a naming system are named in the same way and follow the same naming convention. Clients use the naming service to locate objects by name.

Read full answer

8. What is the core interface of JNDI?

Context interface is the core interface for looking up, binding/unbinding, renaming objects and creating and destroying subcontexts.

Read full answer

9. What is LDAP?

Lightweight Directory Access Protocol (LDAP) is a protocol for locating organizations, individuals, and other resources such as files and devices in a network, whether on the public Internet or on a corporate intranet. LDAP is developed by the University of Michigan.

Read full answer

10. What is JNDI InitialContext?

All naming operations are relative to a context. The InitalContext implements the Context interface and provides an entry point for the resolution of names.

Read full answer

11. How does JNDI relate to LDAP?

JNDI provides an excellent object-oriented abstraction of directory and naming. Developers using JNDI can produce queries that use LDAP or other access protocols to retrieve results.

Read full answer

12. Does JNDI support Security?

Yes. JNDI allows for applications to work in conjunction with directory-specific security systems.

Read full answer

13. What is JNDI Lookup?

lookup() attempts to find the specified object in the given context. It looks for a single, specific object and either finds it in the current JNDI context or it fails.

Read full answer

14. Components of JNDI.

The JNDI architecture consists of an API and a service provider interface (SPI). Java applications use the JNDI API to access a variety of naming and directory services. Naming Interface organizes information hierarchically and maps human-friendly names to addresses or objects that are machine-fr...

Read full answer

15. Why do we need JNDI when communication using LDAP is possible?

JNDI provides lookup of resources like a database or a message queue enabling a uniform way to access directory services.

Read full answer

16. Difference between JNDI lookup and search.

lookup() finds the specified object in the given context or it fails. search() attempts to return an enumeration of all of the objects matching a given set of search criteria and also it can search across multiple contexts. lookup find and return single object in one context while search may retu...

Read full answer

17. Difference between JNDI list and listBindings method.

list() attempts to return an enumeration of all of the objects in the current context as NameClassPair. listBindings() attempts to return an enumeration of all the object bindings in the current context.

Read full answer

«
»
RMI

Comments & Discussions