O'Reilly logo

J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software by Art Taylor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

JNDI Coding Examples

The most common use of JNDI in Java applications is to access resources in a naming service. Since JNDI allows access to a variety of naming services, the resource access can be one of a number of different types of resources. The resource could simply be a string or other primitive data type containing some important program property, such as a closing date for an accounting transaction, the name of a server that contains a resource, or a standard discount rate for a transaction. Or more commonly, the resource could be an object that encapsulates access to a service such as a database or a message queue.

The JDBC DataSource object is the method of choice for accessing a database. The DataSource contains the information needed ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required