DB2 uses "pessimistic" locking, which means it locks automatically based on the SQL statement (select, insert, update, delete), so there is no command to explicitly lock a row. You can issue a lock table SQL statement (in share mode or exclusive mode).
There are different kinds of locks, such as share (S) locks and exclusive (X) locks (and other kinds). Share locks are compatible with each other, so multiple share locks can be on the same row without a problem. But X locks do not allow other X locks or any S locks.
Locks are always released when a commit happens, but a share lock may be released sooner depending on the isolation level. Isolation level determines how long a share lock is held. With CS, the row is only locked while the cursor is on that particular row. With RR, the share lock is held until a commit is issued. All X locks are held until a commit is issued. Refer to the Administration Guide: Performance for details on locks and isolation level.
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390