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 objects include the Connection, Command, and Recordset objects.

The Connection object 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 object represents the records returned from a query. You can use either an SQL string or a Command object to specify the query.

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

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

Once a recordset has been retrieved, either through a Recordset object 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 Getting Started with ADO 2.0.