setCursorName(String name)


void setCursorName(String name)
                   throws SQLException


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.



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


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


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