java.lang.AbstractMethodError: com.mysql.jdbc.Connection.isValid(I)Z
java.lang.AbstractMethodError: com.mysql.jdbc.Connection.isValid(I)Z
This means that the MySQL JDBC driver is outdated as such that it doesn't support Java 1.6's Connection#isValid()
method.
Upgrade it. And make sure that you've only one MySQL JDBC driver JAR file in the runtime classpath.
See also:
- Connect Java to a MySQL database
For me, the solution was not to upgrade my driver (JT400). Even the latest version (9.1) appears to not have implemented isValid() (it's commented out in the code?).
What worked for me was to provide a validationQuery to my database connection pool. E.g.:
validationQuery=SELECT current date FROM sysibm.sysdummy1
net.sourceforge.jtds.jdbc.JtdsConnection
doesn't implement isValid()
So you need to specify a connection-test-query to ensure that isValid()
method isn't called
Adding the following line to application.properties
file resolved the error for me.
spring.datasource.hikari.connection-test-query=SELECT 1