The PreparedStatement Interface

Statement objects are the simplest way to execute SQL statements. But the Statement objects are not optimized or tuned and so they suffer from poor performance when complex SQL statements are executed. This happens primarily because the Statement object is responsible for building the SQL statement. The Statement object sends the SQL statement to the database where it is then checked for syntax and semantics, compiled, and executed. Because this process occurs for each SQL statement executed using the Statement object, complex SQL statements or repetitive SQL statements perform poorly. To get around this, the JDBC API provides an improved and optimized version of the Statement object called the PreparedStatement ...

Get Sams Teach Yourself BEA WebLogic Server 7.0™ in 21 Days 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.