| Sun Java System Application Server |
The CMP Customer application demonstrates using Container Managed Persistence (CMP) Enterprise JavaBeans (EJBs).
Before you deploy or run the application, you must ensure that a database
resource has been configured for Application Server. The included asant
deployment script automatically performs this step for you.
But if you useanother deployment mechanism, you must perform it manually.
You can use any JDBC-compliant relational database server, but specific instructions are provided for the following:
The CMP Customer application requires configuration of JDBC resources.
You do not need to register the resources separately when you deploy the application
using the asant deploy command.
But if you use another deployment mechanism, you must perform it manually as follows:
asadmin create-jdbc-connection-pool --host admin-host --port admin-port --user user --password password --datasourceclassname datasource classname --property User=pbpublic:Password=pbpublic:url-property="JDBC URL" cmpcustomer-poolFor Derby, use DatabaseName as the value for url-property. You must escape colons (:) and slashes (/) in JDBC URL. An example of JDBC URL is
jdbc\:derby\:\/\/localhost\:1527\/DerbyDB;create=true.
asadmin create-jdbc-resource --host admin host --port admin port --user user --password password --connectionpoolid "cmpcustomer-pool jdbc/cmpcustomer"
asadmin create-persistence-resource --host admin-host --port admin-port --user user --password password --jdbcjndiname jdbc/cmpcustomer --factoryclass com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl jdo/cmpcustomer
The general instructions for building, deploying, and running sample applications are provided in Building, Deploying, and Running Sample Applications. In reading this document, use the following application-specific variables for this application:
install_dir is the directory where Application Server
is installed.
app_dir is the application base directory: install_dir/samples/ejb/cmp/apps/cmpcustomer.
cmpcustomer.ear.
Follow this general procedure:
build.xml, is in the app_dir
directory, specifically, install_dir/samples/ejb/cmp/apps/cmpcustomer.
install_dir/samples/ejb/cmp/apps/cmpcustomer/cmpcustomer.ear.
Copyright © 2006 Sun Microsystems, Inc. All rights reserved.