DB beans for database access
DB beans provide applications with easy access to database information without directly using the JDBC interface.
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 are able to access any database that has a JDBC driver. 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.
Table 1. DB beans main 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.
Table 2. DB beans auxiliary classes 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.
Related tasks
Creating a Java Bean that issues an SQL statement
Creating a Java Bean that calls a stored procedure
Related reference
JavaDoc for DB beans