Difference between ResultSet and RowSet java


What is Difference between ResultSet and RowSet in java JDBC

javax.sql.RowSet is an interface which can be used as a JavaBeans component in a visual Bean development environment, It can be created and configured at design time and can be executed at runtime in java.



javax.sql.rowset.RowSet is a wrapper around a ResultSet which makes it possible to use the result set as a JavaBeans component in jdbc java.

ResultSet alone cannot be used as a JavaBeans component.

RowSet interface extends ResultSet interface in java.

javax.sql.rowset.JdbcRowSet the subclass of RowSet is a wrapper around a ResultSet which makes it possible to use the result set as a JavaBeans component.

Implementations of RowSet can be Connected or Disconnected.

Connected implementations of RowSet in JDBC java
  • javax.sql.rowset.JdbcRowSet

Disconnected implementations of RowSet in JDBC java
  • javax.sql.rowset.CachedRowSet
  • javax.sql.rowset.WebRowSet
  • javax.sql.rowset.FilteredRowSet
  • javax.sql.rowset.JoinRowSet

More about Connected implementations of Rowset >
JdbcRowSet extends RowSet

More about Disconnected implementations of Rowset >
CachedRowSet extends RowSet
WebRowSet extends CachedRowSet
FilteredRowSet and JoinRowSet extends WebRowSet

What is Connected implementations of RowSet ?
connected rowset means it continues to maintain its connection with database after retrieval of data as well

What is Disconnected implementations of RowSet ?
Disconnected rowset means it doesn’t continues to maintain its connection with database after retrieval of data as well. It disconnects after retrieval of data.


Related >

JDBC - What is ResultSet in java - Types, concurrency, holdability of ResultSet in java

Labels: Core Java JDBC
eEdit
Must read for you :