When the WebSphere Application Server deployment tooling deploys
an EJB jar file containing container-managed persistence (CMP) enterprise
beans, it selects the target database and creates a corresponding Table.ddl file.
This file contains the SQL statement necessary to generate the database table
for your CMP beans.
About this task
The following steps demonstrate the process for creating tables
in DB2.
Procedure
- Extract the Table.ddl file from your CMP
enterprise bean JAR file and save it on your database server.
Save the file to a working directory, such as C:\temp,
on your DB2 machine.
Save the file to a temporary directory on your work station.
Transfer the file to a data set on your DB2 for z/OS system.
- Run the Table.ddl file.
Run the command C:\temp>db2cmd, replacing C:\temp with
your chosen directory. A DB2 command window is displayed, in which you enter
the following commands (replacing C:\temp with your chosen directory):
- C:\temp>db2 connect to your_db_name
- C:\temp>db2 -tf Table.ddl //This command runs and creates
tables for your CMP enterprise bean.
- C:\temp>db2 disconnect all
Specify the data set as the input data set to SPUFI, and
run the program.
Results
The database tables are created.