6.3.9.2 The Operational Procedure of Using the JDBC RowSet Object
A compliant JDBC RowSet implementation must implement one or more standard interfaces speci-fied in this package and may extend the BaseRowSet abstract class. For example, a CachedRowSet implementation must implement the CachedRowSet interface and extend the BaseRowSet abstract class. The BaseRowSet class provides the standard architecture on which all RowSet implementa-tions should be built, regardless of whether the RowSet objects exist in a connected or disconnected environment. The BaseRowSet abstract class provides any RowSet implementation with its base functionality, including property manipulation and event notification, that is fully compliant with JavaBeans component requirements. As an example, all implementations provided in the reference implementations (contained in the com.sun.rowset package) use the BaseRowSet class as a basis for their implementations.

Table 6.6 illustrates the features that the BaseRowSet abstract class provides.
In this application, we will concentrate on the implementation of the CachedRowSet component, since we prefer to use a disconnected RowSet.
Generally, the operational procedure of using a RowSet object to query data can be divided into the following four steps:
1) Set up and conFigure a RowSet object.
2) Register the RowSet Listeners.
3) Set input and output parameters for the query command.
4) Traverse through the result rows from the ResultSet.
The first step is to set up and conFigure the static or dynamic properties of a RowSet object, such as the connection url, username, password and run command, to allow the RowSet object to con-nect to the data source, pass user parameters into the data source and perform data queries.
The second step allows users to register different Listeners for the RowSet object with differ-ent event sources. The RowSet feature supports registering multiple listeners with the RowSet object. Listeners can be registered using the addRowSetListener() method and unregistered through the removeRowSetListener() method. A listener can implement the javax.sql. RowSetListener interface to register itself as the RowSet listener. Three types of events are sup-ported by the RowSet interface:
1) cursorMoved event: Generated whenever there is a cursor movement, which occurs when the next() or previous() method is called.
2) rowChanged event: Generated when a new row is inserted, updated or deleted from the row set.
3) rowsetChanged event: Generated when the whole row set is created or changed.
In our applications, the Apache NetBeans IDE 12 is used, and the event-listener model has been set up by NetBeans IDE. So we can skip this step.
Step 3 allows users to set up all static or dynamic parameters for the query statement of the RowSet object. Depending on the data type of the parameters used in the query statement, suiTable setXXX() method should used to perform this parameter setup process.
The fourth step is used to retrieve each row from the ResultSet object.
A point to be noted when using any RowSet object to perform data query is that most RowSet classes are abstract classes, and they cannot be instantiated directly. One needs to use a suiTable RowSet Implementation class to create a RowSet implementation object to perform a data query. Also, a RowSet can be implemented in two ways: direct implementation and distributed implemen-tation via a ResultSet. We will use the first way in our project.
Let’s modify the project OracleSelectCourse and make it our new project, OracleSelect Student. Just right-click that project, and select Copy item. Then enter OracleSelectStudent into the Project Name box in the opened Copy Project wizard, and click on the Copy button.