Q&A

Q1:What are the main class and interface used in accessing a JNDI service?
A1: Clients access a JNDI service provider by establishing a Context using the InitialContext interface. Clients look up objects in the JNDI service by using an object name.
Q2:What are the required parameter(s) to specify in order to connect to a JNDI service?
A2: Clients must specify both the provider name (by Context.INITIAL_CONTEXT_FACTORY) and the JNDI URL (by Context.PROVIDER_URL) to connect to a JNDI service provider.

Get Sams Teach Yourself EJB in 21 Days 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.