setCursorName(String name)

Syntax:

void setCursorName(String name)
                   throws SQLException

Description:

Sets the SQL cursor name to the given String, which will be used by subsequent Statement object execute methods. This name can then be used in SQL positioned update or delete statements to identify the current row in the ResultSet object generated by this statement. To insure that a cursor has the proper isolation level to support updates, the cursor's SELECT statement should have the form SELECT FOR UPDATE. If FOR UPDATE is not present, positioned updates may fail.

Note: By definition, the execution of positioned updates and deletes must be done by a different Statement object than the one that generated the ResultSet object being used for positioning. Also, cursor names must be unique within a connection.

Parameters:

name

the new cursor name, which must be unique within a connection

Throws:

SQLException - if a database access error occurs or the statement has been closed

Reference:

For more information, reference JDBC documentation for: Statement.setCursorName(String)