If
you use the component name space method (for example, java:comp/env)
for data source retrieval, ensure that your application defines these
resource references so that you can use these JNDI names to access
the data source. This component name space configuration provides
more flexibility if you must alter the configuration for the data
source. Otherwise, the standard, direct JNDI is used as the data source
name. For more information about using the JNDI interface, see the
topic, Developing applications that use JNDI. For example, the
persistence.xml file
would have an entry like the following:
<jta-data-source>java:comp/env/jdbc/DataSourceJNDI</jta-data-source>
OR
<jta-data-source>jdbc/DataSourceJNDI</jta-data-source>