- statement.executeUpdate("Begin Work");
- statement.executeUpdate("set transaction isolation level serializable");
Above code must be used be before the SELECT statement execution which must be UPDATE.
- String sql_1="select * from table where name='sujith' FOR UPDATE";
Execute the sql and proceed with the business logic. When you want to UPDATE the table do the following.
- String sql_2=update table set name="delp" where name="sujith";
Execute the UPDATE statement, like above statement.
Then use below command for commiting transaction to database.
- statement.executeUpdate("commit");