RowSets are a JDBC 2.0 extension to the java.sql.ResultSet interface. Guess what, it makes life a lot easier for all JDBC programmers. No more Connection objects, statement objects, just a single RowSet will do everything for you.

Rowsets make it easy to send tabular data over a network. They can also be used to provide scrollable result sets or updatable result sets when the underlying JDBC driver does not support them.

A RowSet object contains a set of rows from a result set or some other source of tabular data, like a file or spreadsheet. Because a RowSet object follows the JavaBeans model for properties and event notification, it is a JavaBeans component that can be combined with other components in an application. As is true with other Beans, application programmers will probably use a development tool to create a RowSet object and set its properties.

Rowsets may have many different implementations to fill different needs. These implementations fall into two broad categories, rowsets that are connected and those that are disconnected.

The following code snippet might make the usage of RowSets a bit clear :

...

import javax.sql.RowSet;
import oracle.jdbc.rowset.OracleJDBCRowSet;

....

RowSet rowset = new OracleJDBCRowSet();
rowset.setUsername(username);
rowset.setPassword(password);
rowset.setUrl(url);
rowset.setConcurrency(ResultSet.CONCUR_UPDATABLE);
rowset.setCommand(query);
rowset.execute();

while ( rowset.next() )
{
// These variables have been declared earlier

callType = rowset.getString("CALL_TYPE");
otherNumber= rowset.getString("OTHER_NUMBER");
timestamp = rowset.getTimestamp("CHARGING_TIMESTAMP");
volume = rowset.getInt("VOLUME");

rowset.updateFloat("CHARGE", volume * 0.50);
rowset.updateRow();
}
// Closing the DB connection.
rowset.close();
...




The required jars : ojdbc14.jar, ocr12.zip, ocr12.jar comes along with Oracle 9i.

___________________

The following links will give you a headstart with RowSets :

Tutorials :

http://java.sun.com/developer/Books/.../chapter5.html
http://otn.oracle.com/sample_code/tu...rowsettoc.html
http://edocs.bea.com/wls/docs81/jdbc/rowsets.html

Implementation Downloads

http://java.sun.com/products/jdbc/download.html

Rowset implementations : Public Review :

http://www.jcp.org/en/jsr/detail?id=114
http://www.theserverside.com/news/th...hread_id=21198

Cheers,
Amit Ray.

Those people who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)