home |contents |previous |next |seek  

 

 

 

 

 

     

 

2   RowSet

 

 

 

 

An object RowSet is a datastore for tabular data, consisting of one or  more lines. In a basic implementation of the RowSet, lines

 are extracted from a JDBC data source, but a rowset could load on the data from a spreadsheet, a flat file, or any data source with  tabular format. An object RowSet extends a ResultSet interface, it that means can be navigable, updatable, usually can do everything  what makes a ResultSet.

An object RowSet differs from a ResultSet as it is a component JavaBeans. So has a set of properties and a model for events like every JavaBeans. By setting the properties of which has a RowSet can establish a proper connection with the database and run statments  for fetch data. A Rowset can be disconnected, that is, without maintain open connection with the database.

The interface RowSet provides a set of basic methods common to all types of rowsets described here. All RowSet are JavaBeans components; therefore  it has methods to add or remove event listener. A rowset using a connection to execute commands and return results. You can use connection for writing data in the database. Moreover RowSet has  methods (one for each type of data) to set the values of parameters a SQL string to be sent.

A component that wants to be notified for events generated by a  RowSet must to build an interface RowSetListener and register it at the object RowSet. Such a component called listener,

 It is usually a component GUI (graphical user interface) as a table or graph, which displays the data of a RowSet.

A Rowsets can be connected or disconnected. A RowSet connected can maintain a connection to the whole operation, while a  Rowset disconnected is connected to the source data only while read or writes data.

When it is disconnected it not needs JDBC driver. This is ideal to send data to a thin client. The client can update the data and  postponing the rowset to application servers. On the server, RowSet disconnected is used to connect with the database and rewrite data.

 

 

 

 

Copyright©2008. All rights reserved.