Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Upgrade and Migration Guide

- Previous: Migrating Java Server Pages and JSP Custom Tag Libraries
- Next: Declaring EJBs in the JNDI Context

### Obtaining a Data Source from the JNDI Context

To obtain a reference to a data source bound to the JNDI context, look up the data source’s JNDI name from the initial context object. The object retrieved in this way is then be cast as a DataSource type object:

    ds = (DataSource)ctx.lookup(JndiDataSourceName);

For detailed information, refer to section “Migrating JDBC Code.”

- Previous: Migrating Java Server Pages and JSP Custom Tag Libraries
- Next: Declaring EJBs in the JNDI Context

- © 2010, Oracle Corporation and/or its affiliates