Sun Java System Application Server Platform Edition 8.2 Developer's Guide

Configuring the CMP Resource

An EJB module that contains CMP beans requires the JNDI name of a JDBC resource or Persistence Manager resource in the jndi-name subelement of the cmp-resource element in the sun-ejb-jar.xml file. If the JNDI name refers to a JDBC Resource, set PersistenceManagerFactory properties as properties of the cmp-resource element in the sun-ejb-jar.xml file.

In the Administration Console, open the Resources component, then select JDBC or Persistence Managers. Refer to the Sun Java System Application Server Platform Edition 8.2 Administration Guide for information on creating a new CMP resource.

For a list of the JDBC drivers currently supported by the Application Server, see the Sun Java System Application Server Platform Edition 8.2 Release Notes. For configurations of supported and other drivers, see Configurations for Specific JDBC Drivers.

For example, if the JDBC resource has the JNDI name jdbc/MyDatabase, set the CMP resource in the sun-ejb-jar.xml file as follows:

<cmp-resource>
   <jndi-name>jdbc/MyDatabase</jndi-name>
</cmp-resource>

For another example, if the Persistence Manager has the JNDI name jdo/MyDatabase, set the CMP resource in the sun-ejb-jar.xml file as follows:

<cmp-resource>
   <jndi-name>jdo/MyDatabase</jndi-name>
</cmp-resource>