
Chapter 8. DB2 UDB V8 and WAS V5 integrated performance 297
A
PreparedStatement object, representing a given SQL statement, can appear
multiple times in the prepared statement cache. In particular, it can appear once
for every connection in the connection pool. In Figure 8-2 on page 296,
statements 1 and 2 appear three times—once for each connection. Statement 3
does not appear for connection 3, and Statements 4 and 5 only appear for
connection 3. Hence, it might take a little longer to execute Statements 4 and 5 if
they occur on Connections 1 and 2 because of the need to recompile them for
those connections. A better alternative for this example ...