You should not need to lock a table for reading. Reading a record works without locking.
What is the reason that you have this requirement?
Some databases allow you to lock when you do a
It doesn't guarantee that you have a row, segment, or table lock. You will have to properly release the lock (by closing the transaction). Read your database's documentation on the 'for update' clause, and if it does what you want.