.I%Berkeley DB: Db.cursor[P

Db.cursor





import com.sleepycat.db.*;

)public Dbc cursor(DbTxn txnid, int flags) throws DbException;





Description



The Db.cursor methodcreates a cursor.

MA cursor is a structure used to provide sequential access through a database.FThis interface and its associated functions replaces the functionalityHprovided by the seq function in previous releases of Berkeley DB.

;If the file is being accessed under transaction protection,<the txnid parameter is a transaction ID returned fromQDbTxnMgr.begin, otherwise, NULL.GIf transaction protection is enabled, cursors must be opened and closedCwithin the context of a transaction, and the txnid parameterBspecifies the transaction context in which the cursor may be used.

,The flags parameter must be set to 0.

RIn addition, the following value may be set by logically OR'ing it into theflags parameter:

S

DB_RMW
Specify that the cursor will be used to update the database. Thiswflag should only be set when the Db.DB_INIT_CDB flagOwas specified to DbEnv.appinit.


The Db.cursorHmethod throws an exception that encapsulates an errno on failure.



Errors

QIf a fatal error occurs in Berkeley DB, the Db.cursor method may fail and throw a}DbRunRecoveryException, at which point all subsequent database%calls will also fail in the same way.

The Db.cursor&method may fail and throw an exceptionKfor any of the errors specified for the following Berkeley DB and C library functions:__ham_c_init(3),free(3),<DbLockTab.id, malloc(3), memcpy(3),and memset(3).

In addition, the Db.cursor&method may fail and throw an exceptionencapsulating errnofor the following conditions:

B

EINVAL
An invalid flag value or parameter was specified.







Class

-Db



See Also

4Db.close, Db.cursor,0Db.del,.Db.fd,0Db.get,HDb.get_byteswapped,:Db.get_type,2Db.join,2Db.open,0Db.put,1Db.statand2Db.sync.
ÿÿ