Locking, when it comes to DBs, is
always better left to the Database. Consider the effect synchronized DB access will have on the performance of you application! Think why you would lock access when updating a row:
1. deadlock
2. race conditions
Deadlock is a very well understood problem in the world of RDBMSs. Its best left to them to handle possible collisions. Some are better then others (it takes more concurrent to cause a deadlock in Oracle than it does in SQL Server for example) but almost all are going to be better at handling this than you are in your code.
Race conditions are more common, since
JDBC is usually used in a multiuser/multithread environment. In this case a locking startegy is a better route to protecting against the bugs race conditions can throw up. Optimistic locking works in most situations, and is a much better solution.