Operating Systems: i5/OS
             Personalize the table of contents and search results

 

Example: Looking up a JavaMail session with JNDI

 

A program can conduct a JNDI lookup of a JavaMail resource. Deployment descriptors of the application determine the lookup name that you specify.

The following example shows a lookup of a JavaMail resource:

// Get the initial context as shown above
...
Session session =
     (Session) initialContext.lookup("java:comp/env/mail/MailSession");



 

Related tasks


Developing applications that use JNDI

 

Reference topic