Explain the difference between RowSet and ResultSet in JDBC?


Following are the differences between RowSet and ResultSet:

ResultSetRowSet
A ResultSet always maintains connection with the database.A RowSet can be connected, disconnected from the database.
It cannot be serialized.A RowSet object can be serialized.
ResultSet object cannot be passed other over network.You can pass a RowSet object over the network.
ResultSet object is not a JavaBean object
You can create/get a result set using the executeQuery() method.
ResultSet Object is a JavaBean object.
You can get a RowSet using the RowSetProvider.newFactory().createJdb cRowSet() method.
By default, ResultSet object is not scrollable or, updatable.By default, RowSet object is scrollable and updatable.

Updated on: 09-Mar-2020

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements