/**
* Deletes the current row from this <code>ResultSet</code> object
* and from the underlying database. This method cannot be called when
* the cursor is on the insert row.
*
* @exception SQLException if a database access error occurs
* or if this method is called when the cursor is on the insert row
* @since 1.2
*/
void deleteRow() throws SQLException;
This method cannot be called when the cursor is on the insert row.
* Deletes the current row from this <code>ResultSet</code> object
* and from the underlying database. This method cannot be called when
* the cursor is on the insert row.
*
* @exception SQLException if a database access error occurs
* or if this method is called when the cursor is on the insert row
* @since 1.2
*/
void deleteRow() throws SQLException;
This method cannot be called when the cursor is on the insert row.
System.out.println("Start deleteRow");
Statement statement = null;
ResultSet resultSet = null;
int i = 1;
statement =
connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
String sql = "select oid, * from perf_data where
username='abc'"; //This can be any select statement
//statement.setFetchSize(1000); resultSet = statement.executeQuery( sql );
resultSet.last();
System.out.println("row count: " + resultSet.getRow());
resultSet.beforeFirst();
while ( resultSet.next()) { System.out.println( "row #: " + resultSet.getRow());
System.out.println("Deleting Row:" + i);
resultSet.deleteRow();
System.out.println("Done Deleting Row:" + i);
System.out.println( "row #: " + resultSet.getRow());
i++;
}
resultSet.close();
statement.close();
System.out.println("End deleteRow");
}