Skip to Content
Former Member
May 30, 2008 at 11:57 AM

PreparedStatements after Connection close on DB Pool



I have a quick question about prepared statements.

We have a set of databases which have the same datastructure (for different production locations). If I prepare a statement, this one is parsed against the datasource. Afterwards I do my selects with different parameters over the prepared statement and finally close the db connection. This returns the connection to the db pool of the JDBC Connector. But what will happen to the prepared statement? Is this also closed? What if I connect to another Datasource and have the prepared statement already parsed against another DataSource?

What if I get another Connection from the DB Pool with the same DataSource, is the statement then already parsed?

I have searched the internet for answers, but with no success.