Deleting a Row from a Database Table Using an Updatable Result Set
try {
// Create an updatable result set
Statement stmt = connection.createStatement(
ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
ResultSet resultSet = stmt.executeQuery("SELECT * FROM my_table");
// Delete the first row
resultSet.first();
resultSet.deleteRow();
} catch (SQLException e) {
}
Post a comment