Recreating database tables from the exported table data definition language

When an EAR file deploys, the target database is selected. Then, an appropriate Table.ddl file is created that contains the SQL statements to create the table for the bean. You can then use iSeries Navigator to create the database on your iSeries server.

To create your table with the Table.ddl file for DB2, perform these steps in iSeries Navigator:

  1. The container-managed bean (CMP) enterprise bean JAR file has a Table.ddl file that the Application Assembly Tool (AAT) generates. Extract the Table.ddl file to a working directory on your iSeries server (in the integrated file system).

  2. Start iSeries Navigator.

  3. Expand the iSeries icon for the system where you want to create the database file.

  4. Expand Database, and right-click the system database.

  5. Select Run SQL Scripts...

  6. Select File --> Open.

  7. Navigate to the Table.ddl file that was extracted, and select Open.

  8. In the file, create a database (or collection). Specify the following SQL statement as the first statement in the file:

    CREATE COLLECTION collection;

    where collection is the name of the database.

  9. Select Run --> All to run all of the commands that are contained within the script.

  10. Select View --> Job Log..., and verify that the table was created successfully.

  11. Select File --> Save to save the file.