The z/OS Database Application Generator wizard automatically generates CICS COBOL code that accesses DB2. It also generates a Web service, as well as the JCL that will help you implement the generated code. The Database Application Generator provides CRUD (create, read, update, delete) and LIST operations for the COBOL programs generated.
The generated COBOL consists of two programs per DB2 table. The first is the standard CRUD operations set acting on a single record. The second program handles the search/list operation for multiple rows.
The Database Application Generator enables you to use an existing database schema to rapidly create a z/OS data access layer for Web services. In addition, you can work directly from a UML model. This tutorial covers only the UML transformation.
Figure 1 illustrates the Database Application Generator architecture.
Figure 1. Database Application Generator architecture
In UML, models contain model elements, such as actors, use cases, classes, and packages, along with one or more diagrams that show a specific perspective of a system. In model-driven development, you can work from a UML model that might correspond to a DB2 table. Each UML class you use in this tutorial will map to a DB2 table that has not yet been created. The tutorial assumes that you have created the UML model using Rational Software Architect and want to transform this into a database and also generate COBOL programs using the Database Application generator wizards.
The assumptions when working with UML are:
- Any class in the UML is treated as a DB2 table.
- Any property of a class is treated as a column.
- Other UML items, including operations and methods in the class, are ignored.
If you do not have Rational Software Architect, you can follow this tutorial by importing the UML model provided (Simple Bank Model.uml) into WebSphere Developer. The UML model used in this tutorial is shown in Figure 2 in the next section.
The main steps to create and deploy the assets using the wizard are:
- Export the UML model from Rational Software Architect.
- Import the UML model to Developer for System.
- Use the Database Application Generator wizard to edit and configure the transformation parameters.
- Run the transformation.
- Create the z/OS DB2 table.
- Deploy the generated code.
- Configure and install the CICS Web services on z/OS.
- Test the Web services created.
These steps are covered in this tutorial.