Open In App

Java JDBC – Difference Between Row Set and Result Set

 ResultSet characteristics are as follows:

RowSet  characteristics are as follows:



Note: RowSet is alternate to ResultSet but is more effective than ResultSet



Now let us wrap up differentiating them that is as follows:

          RowSet                                                                                     ResultSet                                              
RowSet is present in the javax.sql package  ResultSet is present in the java.sql package 
A Row Set can be connected, disconnected from the database. A ResultSet always maintains the connection with the database.
RowSet is scrollable providing more flexibility   ResultSet by default is always forward only 
 A Row Set object can be serialized. It cannot be serialized.
You can pass a Row Set object over the network. ResultSet object cannot be passed other over the network.

Result Set Object is a JavaBean object.

 RowSet using the RowSetProvider.newFactory().createJdb cRowSet() method.

Result Set object is not a JavaBean object

result set using the executeQuery() method

ResultSetBy default, RowSet object is scrollable and updatable. By default, the ResultSet object is not scrollable or, updatable.
Article Tags :