I need to obtain a lock on an entire table whilst I am executing an insert query

AND at the same time a lock on a particular row of another table which allows only update

am trying out something like
stm_u.executeQuery("LOCK TABLES sequence WRITE");

and to unlock: stm_u.executeQuery("UNLOCK TABLES");

can anyone help me out with the query??

Am using MySQL 3.23

The query syntax runs fine with PHP... but not with JSP---