The PreparedStatement

The PreparedStatement provides a certain degree of convenience for the Java database developer. Once a SQL statement has been prepared, its object representation becomes the PreparedStatement object. The parameters of the query can be changed not by restating the query, but by making method calls on the PreparedStatement object.

If the full range of queries to be presented to an application are known when the application is being developed, and the range of queries is limited and manageable, then it may make very good sense to use the PreparedStatement class to develop the application.

If all of the queries an application may need to run are known beforehand and the number of queries is limited, then it probably makes sense ...

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.