2

1

4

ITSODB

3

Figure 5-5 Overview of the Java application

￿: The main class in the application is the MigrateMainController. The first action is to retrieve the current database configuration. This is done by

issuing a set of queries against the DB2 metadata in ITSODB. In the figure only the TableInfoQuery is shown. Other queries are left out to keep the figure simple. The MigrateMainController has now access to both the new and the current configuration which is shipped with the controller.

￿ : The ChangeController is then initiated taking the two DatabaseConfiguration classes as input parameters. The ChangeController compares the two database configurations to determine new tables, tables to be removed, and tables that have to be changed.

￿: For tables, we then use TableChangeController to create the set of required DDL and SQL statements to update ITSODB to meet the new configuration. For each table the set of statements are collected into a job, which are returned back to the MigrateMainController.

￿ : Finally the MigrateMainController uses the MigrateCommand to execute all the jobs against the database. We execute the statements in the same ways as described in 5.2.3, “Using an application” on page 228.

Within the Java application we use the class DatabaseConfiguration to contain the

configuration of a database. This class contains a set of classes that reflect the DB2 metadata. For instance, we use the ColumnInfo class to contain the

250DB2 Deployment Guide

Page 264
Image 264
IBM manual Overview of the Java application, 250 DB2 Deployment Guide