How to Create a Component Table

Previous Next

See Also

To create a component table:

1. On the Catalog's Model and Rules Tab page, double-click on Tables.

The Tables wizard appears.

2. Enter the requested information in each of the wizard's dialogs.

Do NOT physically create the table in the database.

Once the table has been created, you can refine both the table and its columns if required, by double clicking on the table name in the Catalog. You can use the What's This? help in the Tables window for help on each field.

3. Depending upon the type of component you want, on the Catalog's Model and Rules Tab page, open the Components item, and double-click Automation Server or J2EE component.
4. Specify the name of the component, and optionally specify an internal Prog ID. Do NOT specify any of the component methods.
5. On the State tab page, select the Stateful Component check box. Specify whether the lifetime of the component should be Session or transaction.
6. On the State tab page, select the Support Table Component checkbox. Check the UPDATE, INSERT, and DELETE checkboxes. Also check the Participate in Transaction, COMMIT, PRECOMMIT and ROLLBACK checkboxes.
7. You must now connect the table to the component. On the Catalog's Model and Rules Tab page, double-click the name of the table you created earlier. The Tables info window appears.
8. Check the Component Table check box. This specifies that the table is linked to an external component which can act as a database table.

NOTE:

The name of the component must always be the same as the name of the table.

USoft automatically adds the definitions of the following methods to the component:

· QueryExe

 

· QueryFetch

 

· UpdateRow

 

· InsertRow

 

· DeleteRow

 

· PreCommit

 

· Rollback

 

· Commit
9. Create the connector component code using DCOM for example, or find a predefined component. You must include code for each of the methods defined in the previous step. Make sure that when you create these methods, you use their parameters in the same order as they are defined in the Definer.

Note that if you use COM, the parameters that can have a NULL value must be defined as VARIANT. This is, for example, the case with the parameters of the QueryExe method.