PreparedStatements are JDBC objects that you prepare (compile) once
and execute multiple times. See the figure below. If your application executes
statements that are almost but not exactly alike, use PreparedStatements,
which can contain dynamic or IN parameters. Instead of using the literals for
changing parameters, use question marks (
A connection need only compile a PreparedStatement once. Subsequent executions can use the same statement execution plan even if the parameter values are different, as shown in the following figure. (PreparedStatements are not shared across connections.)
When, in the same database, an application submits an SQL Statement
that exactly matches one already in the cache,
To match exactly with a statement already in the cache, the SQL Statement must meet the following requirements:
The following figure shows how
The derby.language.statementCacheSize property controls the number of
precompiled statements which