Java Reference
In-Depth Information
2. Enter lines 95 through 133 as shown in Figure 11-36 on page 735.
TextPad displays the addUser() method (Figure 11-42). This method requires
a User object as a parameter. It uses a PreparedStatement object, serializing
the Password object before inserting it as a variable value.
User object
addUser()
method
PreparedStatement
object
serialized
FIGURE 11-42
3. Enter lines 134 through 145 as shown in Figure 11-36.
TextPad displays the addUserStocks() method (Figure 11-43), which also
uses a Statement object.
static Statement
addUserStocks()
method
FIGURE 11-43
As demonstrated, either a Statement or a PreparedStatement object can be
used to modify the database.
 
Search WWH ::




Custom Search