Adam Bovill wrote:
> Hi Olav,
>
> Thanks.  That seems to have improved things.
>
> I was wondering whether or not there was a way to create one PreparedStatement from another. I have the first one that I've created and would like to clone or duplicate this, w/o needing to recompile it.
>
> So when I'm using a PreparedStatement, I can set the parameters w/o incurring too much of a penalty because it's already compiled?

In order to answer this it would be good to know a bit more about what
you are trying to achieve.  Why do need several prepared statements?
Note that a prepared statement is local to a connection.  If you want
to execute the same statement in another connection, you will have to
prepare it for that connection.  However, Derby has a statement cache
so if the statement is lexically equal to a previous statement, the
result of the previous compilation will be reused, and recompilation
will not be needed.

--
Øystein

Reply via email to