Data Binding in WFC

To access data from your Java project, you typically use the ActiveX Data Objects (ADO) components, which define the data programming model for WFC applications. The core ADO components include the Connection, Command, and Recordset components.

The Connection component allows you to connect to a database. Once a connection is established, you can query the database to retrieve a set of records. The Recordset component represents the records returned from a query. You can use either an SQL string or a Command component to specify the query.

ADO also provides the DataSource component, which combines the functionality of the Connection, Command, and Recordset components. For information about programming with the ADO components, see the ADO Tutorial (VJ++). The ADO components are defined in the wfc.data and wfc.data.ui packages.

Note   The Toolbox in the WFC Designer only provides a DataSource control; the Connection, Command, and Recordset components can only be used in code.

Once a recordset has been retrieved, either through a Recordset component or a DataSource component, you can bind the recordset to a WFC component. WFC supports both simple and complex data binding, described as follows:

Type of Binding Description
Simple Refers to the relationship between a field in a recordset and the property of a WFC component. The binding is called simple because the component does not need explicit knowledge about the data protocol or data provider.
Complex Refers to the direct relationship between a recordset and a WFC component.

Note that the recordsetÆs cursor and lock types determine whether the data in the recordset dynamically reflects the data in the database, and whether the data in the recordset can be changed.

For more information about ADO, see WhatÆs New in ADO 2.0 and Getting Started with ADO 2.0.