You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Gamnacke <ga...@yahoo.se> on 2009/02/25 10:39:28 UTC

DBCP: Why is the validation query not a prepared statement

Is there a reason for why the validation query is not a prepared statement?
In the method
PoolableConnectionFactory.validateConnection(Connection conn) the validation
query is executed as a normal statement (conn.createStatement()).

Would it be unsafe to use a prepared statement here instead?


-- 
View this message in context: http://www.nabble.com/DBCP%3A-Why-is-the-validation-query-not-a-prepared-statement-tp22199341p22199341.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


RE: DBCP: Why is the validation query not a prepared statement

Posted by Gamnacke <ga...@yahoo.se>.
Could that cause the validation to fail, that is, could that cause the
validateConnection() to incorrectly say that a connection is valid while it
is not?
-- 
View this message in context: http://www.nabble.com/DBCP%3A-Why-is-the-validation-query-not-a-prepared-statement-tp22199341p22221683.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


RE: DBCP: Why is the validation query not a prepared statement

Posted by Wes Clark <wc...@guidewire.com>.
This is just a guess, but perhaps some JDBC drivers hold the prepare and
bundle it with the first execute. 

-----Original Message-----
From: Gamnacke [mailto:gamnacke@yahoo.se] 
Sent: Wednesday, February 25, 2009 1:39 AM
To: user@commons.apache.org
Subject: DBCP: Why is the validation query not a prepared statement


Is there a reason for why the validation query is not a prepared
statement?
In the method
PoolableConnectionFactory.validateConnection(Connection conn) the
validation query is executed as a normal statement
(conn.createStatement()).

Would it be unsafe to use a prepared statement here instead?


--
View this message in context:
http://www.nabble.com/DBCP%3A-Why-is-the-validation-query-not-a-prepared
-statement-tp22199341p22199341.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org