Using JNDI Outside J2EE

JNDI is a required technology for J2SE so you do not need to have a full blown J2EE server in order to use JNDI. In fact if you do any work with RMI-IIOP (CORBA) you will be using JNDI to bind and look up the RMI server objects. This is discussed in detail on Day 19. You may also find yourself using JNDI to access an LDAP service, or Microsoft's Active Directory service through its LDAP interface.

If you are working outside of the J2EE environment there are two obvious questions that need answering:

  1. How do I define which type of name service I'm using (CORBA, LDAP, something else)?

  2. How do I define the host name and port number of the server on my network?

The supplementary question is then:

  • What happens if I don't define ...

Get Sams Teach Yourself J2EE™ in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.