Accessing Data

Using the design tools and wizards, you can easily access data in Visual J++. By adding the WFC data controls to your form in the Designer, you can quickly configure how data is retrieved and displayed. You can also run the Data Form Wizard to automatically generate a data-bound form.

Visual J++ provides controls to access data through ActiveX Data Objects (ADO), the data programming model for WFC applications. The core ADO components include the Connection, Command, and Recordset components, which allow you to connect to a database and retrieve a set of records. ADO also provides the DataSource component, which combines the functionality of the Connection, Command, and Recordset components.

Note   The Toolbox in the WFC Designer only provides a DataSource control; the Connection, Command, and Recordset components can only be used in code. For information about programming with the ADO components, see the ADO Tutorial (VJ++).

ADO supports simple data binding through the DataBinder component. This component binds a field from a Recordset or DataSource component to the property of a WFC control. Visual J++ also provides complex data-bound controls, such as the DataGrid and DataNavigator controls, that interact directly with a recordset. For more information about data binding, see Data Binding in WFC.

To access data on a form, you can either run the Data Form Wizard or perform the following steps in the Designer:

For more information about ADO, see WhatÆs New in ADO 2.0 and Getting Started with ADO 2.0. For information about the COM-based data access options available with Visual Studio, see Choosing the Right Data Access Technology.