Subject Re: [Firebird-Java] Can you use PreparedStatements together with connection pooling?
Author Mark Rotteveel
> Hi, in our Java app we have some general-purpose helper classes which hold
> on to some regularly-used PreparedStatements. This all works well.
>
> However we have a java-based web app in which we use connection pooling.
> What happens to these PreparedStatements in this scenario? Are
> PreparedStatements 'bound' in any way to the connection that created them? I.e after the
> PreparedStatement is created, can it be used as its own entity, completely
> independent of the connection on which it was created? If you close the
> original connection it'll break the PreparedStatement, won't it?

A Statement (and PreparedStatement) is always bound to the connection that created it. If the connection is closed all associated statements are closed and can no longer be used.
--
Sicherer, schneller und einfacher. Die aktuellen Internet-Browser -
jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/atbrowser