Configuring an SDO to use on multiple Faces pages

This task is the first of four in a demonstration on how to create a multi-page SDO application. In this task you create a master page, a detail page, and configure and SDO for multiple use.

  1. Create a dynamic Web project with servlet version 2.4 and a WebSphere® Application Server v6.1 target server.
  2. Create two Faces JSPs, for example updateDepartment.jsp (as the master page) and createEmployee.jsp.
  3. With the page you want to use as the master page open, for example, updateDepartment.jsp, in Page Data view, right-click and select New > Relational Record. The Add Relational Record wizard opens.
  4. Enter a name, for example department.
  5. Select the Fill record with existing data from the database button, then click Next.
  6. Create or select a connection to your database. If you have the DB2® V8.2 SAMPLE database installed, you can connect to it and follow along with the examples for the rest of the steps.
  7. On the Record Properties page, select a table, for example, select DEPARTMENT, then click Next.
  8. On the Column Selection and Other Tasks page, if the table does not have a primary key, click Modify primary key.
  9. On the "Edit primary keys" page, select a primary key, for example, DEPTNO:String, then click Close. You return to the On the Column Selection and Other Tasks page.
  10. From the Advanced tasks, click Add another database table through a relationship. The Create Relationship wizard opens.
  11. Select the Create a new relationship button.
  12. Select the table you want to create a relationship with, for example, the EMPLOYEE Table, then click Next.
  13. On the Edit Your Relationship page, select 1->*PRIMARY KEY -> FOREIGN KEY as the multiplicity.
  14. Click Modify <TABLENAME> primary key, for example, Modify EMPLOYEE primary key. The Edit primary keys window opens.
  15. Select a primary key, for example, EMPNO:String, then click Close.
  16. Click on the Choose a column text in the foreign key column and select a column in the drop-down list to use as the foreign key, for example, EMPNO: String.
  17. Click Finish. Verify that you have a Relation node and the correct primary keys, for example:
    Add Relational Record Screen Capture
  18. From the Relation table, select only the columns you want to be able to update, for example, in the EMPLOYEE table select EMPNO, FIRSTNME, MIDINIT, LASTNAME.
  19. Click Finish.
To continue creating a multi-page SDO application, follow these steps:

Feedback