Sun Adapter for Oracle Tutorials

ProcedureCreate the Oracle Database OTD

  1. Right-click your new Project in the Project window, and select New -> Object Type Definition from the popup menu.

    The New Object Type Definition Wizard appears.

  2. In Step 1 of the wizard, select the wizard type. In this case, select Oracle Database as the wizard type. Click Next.

  3. In Step 2 of the wizard, specify the database connection information.

    The connection information fields are:

    • Host name

    • Port

    • Database

    • User name

    • Password

    Once you have entered the correct information in the connection fields, click Next.

  4. In Step 3 of the wizard, select the types of database object you want to include in your project

    For this example, select the following:

    • Tables/Views/Aliases

    • Prepared Statements

    Click Next.

  5. In Step 4 of the wizard, select the table for the project. Click Add. The Add Tables dialog box appears.

  6. From the Add Tables dialog box, search for or enter the name of the database. For this example, use the DB_EMPLOYEE table. When the database appears in the Results selection frame, click Select, and click OK to close the Add Table dialog box.

    Graphic shows the OTD Wizard's Add Tables dialog box,
as described in context.
  7. Click Next. The wizard proceeds to Step 6, Add Prepared Statements. Click Add.

    The Add Prepared Statement dialog box appears.

  8. In the Add Prepared Statements dialog box, enter Select_ps as the Prepared Statement Name, and enter the following as the SQL Statement:

    select * from db_employee where emp_no > ? order by emp_no
    Graphic shows the OTD Wizard's Add Prepared Statement
dialog box containing the SQL Statement, as described in context.
    Note –

    In this example, the SQL statement includes the ? placeholder for input. This placeholder represents the Where Clause.

  9. Click OK to close the Add Prepared Statement dialog box, and then click Next.

  10. In Step 7 of the wizard, enter a name for the OTD. In this example, use otdOracle. Click Next.

  11. In Step 8 of the wizard, review your settings, then click Finish to create the OTD.