Accessing data

In PowerJ, you can use the transaction object to simplify connecting to many types of data sources. You can use either the DataWindow, Java Edition (also known as the DataWindow JavaBeans component) or the query object for SQL statements and data retrieval. You use the query object if you want to use data-bound controls instead of the DataWindow. Both the DataWindow JavaBeans component and the query object can use the transaction object, or they can process result sets without a database connection.

The Database component palette includes icons for adding transaction and query objects to a form. You create instances of the Transaction and Query classes by selecting them in the palette and dropping their icons onto a form.

To display retrieved data, you can use either data-bound controls with the query object, or the DataWindow JavaBeans component. On the Standard component palette, many of the visual controls (such as check boxes, text boxes, and labels) can be connected to a data source and column so that they display the data in the current row of a query object’s result set. You make the connection to the query on the Database page of the control’s property sheet.