Beyond the Basics
Thus far, we've discussed what is minimally required to query databases via JDBC. However, there are a number of additional JDBC techniques that can have a significant impact on performance and scalability. In this section, we'll discuss each of these advanced methods.
Prepared Statements
Recall from our discussion of database concepts that query processing generally boils down to three phases: query parsing and syntactic checking, query plan generation, and plan execution. The first phase can seem unnecessarily costly, especially if we repeatedly execute the same query (or the same kind of query). We know that the SQL is correct and we hope that the database caches previous parsed queries, but we can't be sure. Database vendors ...
Get Building Scalable and High-Performance Java™ Web Applications Using J2EE™ Technology now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.