Java Reference
In-Depth Information
The following steps enter the code to delete related records within a
transaction and then commit or rollback the transaction.
To Commit a Transaction to Delete Related Records
1. Enter lines 205 through 216 as shown in Figure 11-36 on page 736.
TextPad displays the beginning of the delUser() method (Figure 11-46). The
setAutoCommit() method disables the auto-commit mode of the connection
to allow a multiple-statement transaction.
delUser()
method
setAutoCommit()
method
FIGURE 11-46
2. Enter lines 217 through 235 as shown in Figure 11-36.
TextPad displays the code to find and delete all stock holdings for a user
(Figure 11-47). The getUserID() method obtains the user ID from the User
object.
User object
getUserID() method
getUser()
method
loop through
all user stock
holdings
delUserStocks()
method
FIGURE 11-47
 
Search WWH ::




Custom Search