Operating Systems: i5/OS
Personalize the table of contents and search results
Recreating database tables from the exported table data definition
language
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.
Overview
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 in the integrated
file system on your DB2 UDB for iSeries server.
- Run the Table.ddl file.
- Add an SQL CREATE statement to the Table.ddl file,
then run the file:
- Start iSeries Navigator.
- Expand the iSeries icon for the system where you want to create the database
file.
- Expand Database, and right-click on the system database.
- Select Run SQL Scripts...
- Select File > Open.
- Navigate to the Table.ddl file that you extracted,
and select Open.
- Create a database, or collection, in the file by typing the following
SQL statement as the first statement in the Table.ddl file:
CREATE COLLECTION
collection
;
where collection is the name of your database.
- Select Run > All to run all of the commands that are contained
within the Table.ddl file.
- Select View > Job Log... and verify that the table was created
successfully.
- Select File > Save to save the database.
Results
The database tables are created.