Working with relational data: the Select bean

VisualAge for Java supports access to relational databases through JDBC. You can access relational data in an applet or application by using the Data Access beans on the Visual Composition Editor beans palette. (Before you can use the Data Access beans, you must first use the Quick Start window to add the Data Access beans feature to Visual Age for Java, and you must change the classpath. For more information on accessing relational data, refer to the online help.)

The Data Access beans comprise a Select bean and a DBNavigator bean. The Select bean gives you a fast, easy to use, visual programming way of accessing relational data in your applet or application.

To access relational data using the Select bean:

  1. Add the Select bean to the Visual Composition Editor surface.
  2. Edit the Select bean properties. The query property allows you to define the following things:
  3. Connect the Select bean to a visual component of your applet or application, such as a button bean. When a user uses the application or applet, and selects the visual component, for example clicks the button, the SQL statement for the Select bean retrieves a result set.

You can also use the Select bean to apply changes that users make to a result row, even deletion of a row, and commit the changes to the database. In these cases, you use update and delete methods provided by the Select bean.