Introduction

The previous chapters introduced us to the all-important JDBC package and saw how to connect to the database and execute SQL statements. In this chapter, we will look at a common technique for optimizing SQL statement execution using prepared statements and we will examine how we examine the results of our queries using result sets.

As we will see, the PreparedStatement interface provides methods to optimize the query process using the capability of many databases to prepare a database query before it is executed. This preparation process usually involves parsing the query, identifying the query path (how the data in the tables will be accessed), and saving the information so that the query can be executed by simply finding the prepared ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software 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.