Deploying a data access application includes more than installing your web application
archive (WAR) or enterprise archive (EAR) file onto a server. Deployment can include tasks for
configuring your application to use the data access resources of the server and overall runtime
environment.
Before you begin
You can deploy only application code that is assembled into the appropriate modules. See the
topic, Assembling data access applications for guidelines, for this process.
About this task
Perform the following steps if your application requires access to a relational database
(RDB). When your application requires access to a different type of enterprise information system
(EIS), such as an object-oriented database or the Customer Information Control System (CICS®), consult the topics, Relational resource adapters and JCA,
and Accessing data using Java™ EE Connector Architecture
connectors.
Procedure
- If your RDB configuration does not exist, do the following steps:
- Create a database to hold the data.
- Create tables required by your application.
- If your application uses container managed persistence (CMP) entity beans to access the
data
- You can create the tables using the data definition language (DDL) generated from the enterprise
bean configuration. For more information, see the topic, Recreating database tables from the
exported table data definition language.
- If your application uses bean managed persistence (BMP) entity beans, or does not use
entity beans
- You must use your database server interfaces to create the tables.
The Enterprise JavaBeans (EJB) to RDB Mapping wizard
of an assembly tool is also used to create your database tables for either type of entity bean.
Select the top-down mapping option in the wizard. However, this option does not
give you direct control in naming the RDB elements or choosing column types. Additionally, because
the top-down process is automatic, it might not provide mappings to reflect the
precise relationships that you intend.
If you use Rational® Application Developer, consult the
information center about the mapping wizard. To learn about all of your assembly tool options, see
the assembly tools topic in this information center.
- Check the data source minimum required settings by vendor to see any database vendor
requirements for connecting to an application server. See the topic, Data source minimum required
settings, by vendor, for instructions.
- Optional: Map your entity beans to the database tables through the meet-in-the-middle mapping option of
an assembly tool. Complete this step only if you did not create your database schema through the
top-down mapping option, did not generate your mapping relationships through
bottom-up mapping, or did not generate mappings during the application assembly process. For
information about the top-down mapping option see the information center for Rational Application Developer.
- Install your application onto the application server. See the topic, Installing enterprise application files. When you install the application, you
can alter data access settings that were made during application assembly, or, if they were omitted
from the assembly process, set them for the first time. These settings include resource bindings and
resource authentication aliases, which are addressed in the following substeps:
- Bind application resource references to the data sources, or other resource objects, that
provide database connectivity. For details on the concept of binding, see the topic, Data source lookups for enterprise beans
and web modules.
Tip: After deployment, you can use the WebSphere® Application Server administrative console to alter resource
bindings. Click , and select the link to the appropriate mapping page. For example, if you want to
alter the binding of an EJB module resource, you might click Map data sources for all 2.x
CMP beans. For a web module resource, click Resource
references.
- Define authentication alias data for resources that must be authenticated with the backend
through container-managed authorization. In this security configuration, WebSphere
Application Server performs EIS signon for data source or connection factory connections. Consult
the topic, J2EE connector security for detailed reference on resource authentication.
- Start the deployed application files using the administrative console, the wsadmin scripting
tool startApplication command, or your own Java program.
- Save the changes to your administrative configuration.
- Test the application. For example, point a web browser at the URL for a deployed application
and examine the performance of the application.
![[AIX Solaris HP-UX Linux Windows]](../images/dist.gif)
![[IBM i]](../images/iseries.gif)
Results
When you deploy an application that uses a DB2® UDB for IBM® i back-end database, you
might find the following exception in the SystemOut.log file:
PMGR6022E: Error using adapter to create or execute an Interaction
This type of error
indicates that you deployed an application with container-managed persistence (CMP) enterprise beans
that were originally configured to access a DB2 database on
Windows, Linux, or
a supported UNIX system. Using the administrative console,
uninstall the affected CMP applications, then reinstall the applications with the new database
setting. Remember to select
Deploy enterprise beans; on the
EJB
deploy panel, select the appropriate version of your DB2 UDB for IBM i database.
Note: 這個主題參照一或多個應用程式伺服器日誌檔。
此外,在分散式和 IBM i 系統上,另外也建議您可以配置伺服器來使用「高效能可延伸記載 (HPEL)」日誌和追蹤基礎架構,而不使用 SystemOut.log、SystemErr.log, trace.log 及 activity.log 檔案。HPEL 與原生 z/OS® 記載機能也可以一起使用。如果您使用 HPEL,則可以從伺服器設定檔 bin 目錄,利用 LogViewer 指令行工具來存取您所有的日誌和追蹤資訊。請參閱有關利用 HPEL 疑難排解應用程式的資訊,以取得更多使用 HPEL 的相關資訊。
What to do next
If the application does not perform as wanted, update the application, then save and test it
again.