K
Kyle
In an example source file (AddressBook), I found the following codes:
InitialContext initialContext = new InitialContext ();
Context envContext = (Context) initialContext.lookup ("java:comp/env");
DataSource dataSource = (DataSource) envContext.lookup ("jdbc/Public");
I know it is using JNDI. But since the InitialContext is instantiated with
no parameter, the second statement seems strange to me. What does it mean by
"java:comp/env"? is it a standard Name? And the same for jdbc/Public?
BTW, Public is a name of a database.
I did not find any document on "java:comp/env"?
Thanks in advance
Kyle
InitialContext initialContext = new InitialContext ();
Context envContext = (Context) initialContext.lookup ("java:comp/env");
DataSource dataSource = (DataSource) envContext.lookup ("jdbc/Public");
I know it is using JNDI. But since the InitialContext is instantiated with
no parameter, the second statement seems strange to me. What does it mean by
"java:comp/env"? is it a standard Name? And the same for jdbc/Public?
BTW, Public is a name of a database.
I did not find any document on "java:comp/env"?
Thanks in advance
Kyle