Scalability and Performance Hints

Our survey of advanced JDBC techniques has already given us an idea of some of the scalability and performance strategies we can employ. In this section, I review the most important ones and suggest some additional strategies for improving efficiency and throughput.

Use PreparedStatement When Possible

Not surprisingly, precompiling statements can make a big difference in performance. To quantify this a bit, consider how it improves querying 1,000 rows as well as updating 10,000 rows. As I described earlier, a given servlet or EJB instance on a busy site may do this tens of thousands of times over the course of ...

Get Building Scalable and High-Performance Java™ Web Applications Using J2EE™ Technology now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.