Explain the difference between RowSet and ResultSet in JDBC?

JDBCJava 8MySQLMySQLi Database

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.
raja
Published on 20-Mar-2019 16:43:55
Advertisements