Explain CacheRowset, JDBCRowset and WebRowset.CachedRowSet:
A row set that caches the data in the memory after getting the details of a rowset from the database table. It is much faster and ideal for providing thin Java clients.JDBCRowset:
It is connected row set, that has fetched data from the database table. It serves as a thin wrapper around a ResultSet object for treating JDBC driver act as a JavaBeans component.WebRowSet :
It is a connected row set that utilizes Hyper Text Transmission Protocol for interacting with Java servlet which provides the data access from a database. It is useful for thin web clients for retrieving and possibly updating the rows of a database table.
Explain CacheRowset, JDBCRowset and WebRowset.
JdbcRowSet is a connected type of rowset as it maintains a connection to the data source using a JDBC driver
CachedRowSet and WebRoeSet are disconnected types of rowsets as they are connected to the data source only when reading data from it or writing data to it.Example 1:
JdbcRowSet j = new JdbcRowSetImpl();Example 2:
j.setCommand("SELECT * FROM TABLE_NAME);
ResultSet rs = stmt.executeQuery("SELECT * FROM AUTHORS");Example 3:
CachedRowSet crset = new CachedRowSetImpl();
WebRowSet wrs = new WebRowSetImpl();