Bill,

Prepared Statements are on a per-connection level. In fact, if you turn
on DBCP PrepareStatement pooling, a separate PrepareStatement pool will
be maintained for each Db connection. The PreparedStatement therefore is
tightly coupled with the connection that created it.

Paul

-----Original Message-----
From: Hudson, Bill [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 19, 2005 3:34 PM
To: [email protected]
Subject: [dbcp] question regarding connection pooling and prepared
statements

 
Question: I am trying to determine if commons-dbcp provides this
functionality: Can a prepared statement be generated against a
connection obtained from the a connection pool, say "connection x".
Then can connection x be returned to the pool, and at a later time can
the prepared statement be used with a different connection, say
"connection y", obtained from the same connection pool (both connections
against same database, using the same driver).  In other words, if I
maintain a reference to a prepared statement, will that reference be
valid regardless of what connection the underlying pool provides to me
over the course of my application's execution time?

To phrase the question differently: are prepared statements on a
per-connection level, or are they "global" to all connections in the
connection pool?


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to