Part I Development Tasks and Tools
1. Setting Up a Development Environment
Part II Developing Applications and Application Components
6. Using the Java Persistence API
7. Developing Web Applications
8. Using Enterprise JavaBeans Technology
9. Using Container-Managed Persistence
GlassFish Server Support for CMP
The Mapping Deployment Descriptor File
Automatic Primary Key Generation
Fixed Length CHAR Primary Keys
Automatic Schema Generation for CMP
Automatic Database Schema Capture
Using the capture-schema Utility
Version Column Consistency Checking
Configuring Queries for 1.1 Finders
CMP Restrictions and Optimizations
Restrictions on Remote Interfaces
No Support for lock-when-loaded on Sybase
Set RECURSIVE_TRIGGERS to false on MSSQL
12. Developing Lifecycle Listeners
13. Developing OSGi-enabled Java EE Applications
Part III Using Services and APIs
14. Using the JDBC API for Database Access
15. Using the Transaction Service
16. Using the Java Naming and Directory Interface
An EJB module that contains CMP beans requires the JNDI name of a JDBC resource in the jndi-name subelement of the cmp-resource element in the glassfish-ejb-jar.xml file. Set PersistenceManagerFactory properties as properties of the cmp-resource element in the glassfish-ejb-jar.xml file. See cmp-resource in Oracle GlassFish Server 3.1 Application Deployment Guide.
In the Administration Console, open the Resources component, then select JDBC. Click the Help button in the Administration Console for information on creating a new JDBC resource.
For a list of the JDBC drivers currently supported by the GlassFish Server, see the Oracle GlassFish Server 3.1-3.1.1 Release Notes. For configurations of supported and other drivers, see Configuration Specifics for JDBC Drivers in Oracle GlassFish Server 3.1 Administration Guide.
For example, if the JDBC resource has the JNDI name jdbc/MyDatabase, set the CMP resource in the glassfish-ejb-jar.xml file as follows:
<cmp-resource> <jndi-name>jdbc/MyDatabase</jndi-name> </cmp-resource>