Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jdbc validation query

Is there a library which can determine for a jdbc driver class the appropriate validation query to use?

For example If the jdbc driver is com.mysql.jdbc.Driver or com.mysql.jdbc.jdbc2.optional.MysqlXADataSource the library will know the validation query is "SELECT 1"

c3po http://www.mchange.com/projects/c3p0/index.html#preferredTestQuery

dbcp http://commons.apache.org/dbcp/configuration.html "validationQuery"

like image 215
joshjdevl Avatar asked Feb 12 '11 14:02

joshjdevl


1 Answers

JDBC type 4 provides an isValid method

like image 190
joshjdevl Avatar answered Oct 10 '22 19:10

joshjdevl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!