The DB beans classes are provided in the package com.ibm.db.beans. They provide applications an easy alternative to directly using the JDBC interface for database access. These beans use JDBC, and therefore they are able to access any database that has a JDBC driver that uses standard JDBC interfaces. The beans have capabilities that you would otherwise need to implement separately in each JDBC application, such as caching the rows of a result set in memory, and updating or deleting rows of a result set.
This following table summarizes some of the most important DB beans classes.
| Class | Description |
|---|---|
| DBSelect | Runs a query and processes its result set. |
| DBProcedureCall | Calls a stored procedure and processes its input parameters, output parameters and any output result sets. |
| DBModify | Runs an SQL statement that does not produce a result set, for example INSERT, UPDATE, or DELETE. |
The com.ibm.db.beans package also includes some auxiliary classes that you can use to obtain metadata and connection information, and to connect DB beans to the GUI class javax.swing.JTable.
| Class | Description |
|---|---|
| DBSelectMetaData | Describes a result set. |
| DBParameterMetaData | Describes statement parameters. |
| DBConnectionSpec | Shares connection specification information among beans. |
| DBTableModel | Enables a DBSelect or DBProcedureCall object to serve as the model for a JTable. |
Many of the capabilities of the DBSelect class are defined in the JDBC 2.0 RowSet class. DBSelect is a wrapper for the RowSet class that provides a scrollable, updateable result set in a layer on top of an underlying database, even if the database does not provide scrolling, updateable result sets.