I am developing a webapp that uses jTDS to connect to MS SQL Server. I tried to migrate my webapp from Tomcat 7 to recently released Tomcat 8.0.9. Tomcat 8 uses DBCP 2.
Unlike DBCP 1.x, DBCP 2 will call java.sql.Connection.isValid(int) when parameter validationQuery is not set. JTDS doesn't implement isValid method, so jTDS driver won't work with DBCP 2 or Tomcat 8, when validationQuery is not set, which is default. It will throw java.lang.AbstractMethodError.
To workaround, one should just add validationQuery parameter (e.g. validationQuery = "select 1").
Could you add support for isValid method to make the driver work with Tomcat 8 and DBCP 2, even when validationQuery is not set?
-Ognjen
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am developing a webapp that uses jTDS to connect to MS SQL Server. I tried to migrate my webapp from Tomcat 7 to recently released Tomcat 8.0.9. Tomcat 8 uses DBCP 2.
Unlike DBCP 1.x, DBCP 2 will call
java.sql.Connection.isValid(int)when parameter validationQuery is not set. JTDS doesn't implementisValidmethod, so jTDS driver won't work with DBCP 2 or Tomcat 8, when validationQuery is not set, which is default. It will throwjava.lang.AbstractMethodError.To workaround, one should just add
validationQueryparameter (e.g.validationQuery = "select 1").Could you add support for
isValidmethod to make the driver work with Tomcat 8 and DBCP 2, even when validationQuery is not set?-Ognjen
Wow..I finally found out what was wrong, do you care to elaborate on the validationQuery = "select 1" part?
Where should i put it.. in the META-INF/Context.xml?
Right, you shoud put it into <resource> tag for connection pool, which is usually in META-INF/context.xml:</resource>
-Ognjen