The Context

JNDI works with one or more contexts. A context is effectively a namespace, and within a namespace are resources that are identified by a key. A resource is an object that is stored or bound into the namespace using a key and can be retrieved by the key. Namespaces can optionally form a hierarchy much like a directory hierarchy, so that a series of entries relating to computer servers could be organized as follows.

/regional
        /corporate_it
        /corporate_backup
/national
        /north
                /local
                        /departmental
                               /accounting
                               /finance
                               /human_resources
        /south
                /local
                        /departmental
                               /accounting
                               /finance
                               /human_resources

Using this example, a fully qualified path name for a server in the national north region expressed using a forward slash to separate the ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software 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.