JDBC ResultSet Enhancement Update Methods Example

JDBC ResultSet Enhancement Update Methods Example


ResultSet methods JDBC

JDBC 2.0 ResultSet enhancement operations include the methods to update, insert or delete a record without writing the SQL commands.

That is, SQL commands need not be known, of course for CRUD operations. This is the greatness of ResultSet methods JDBC.
Example on ResultSet methods JDBC

ResultSet methods JDBC 2.0 includes insertRow(), moveToInsertRow(), last(), absolute() etc. These methods are used in the following link example.

Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);

The above statement is explained in ResultSet Types and Concurrency.

res.absolute(3);

The above statement is explained in Scrollable ResultSet.

A similar program is available to update a record using refreshRow() method – ResultSet Update Record with Refresh Row.

Leave a Reply

Your email address will not be published. Required fields are marked *