【JavaWeb问题解决】java.lang.AbstractMethodError: com.mysql.jdbc.Connection.isValid(I)Z问题解决

问题描述:
JavaWeb里面或者Java里面通过jdbc连接数据库的时候,会出现如下错误:java.lang.AbstractMethodError: com.mysql.jdbc.Connection.isValid(I)Z at org.apache.tomcat.dbcp.dbcp2.DelegatingConnection.isValid(DelegatingConnection.java:874) at org.apache.tomcat.dbcp.dbcp2.PoolableConnection.validate(PoolableConnection.java:270) at org.apache.tomcat.dbcp.dbcp2.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:630) at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:119) at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:731) at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:605) at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:809).....

原因分析:
这种情况一般就是版本不对应导致,mysql驱动包版本估计过低

解决办法:
下载更高版本jar包,最好是对应版本
Mysql-connector-java各版本下载地址:https://mvnrepository.com/artifact/mysql/mysql-connector-java

查看版本对应关系点击:
mysql-connector-java与mysql以及JDK的对应版本
百度网盘下载地址:https://blog.csdn.net/xunxue1523/article/details/105525139

你可能感兴趣的:(javaweb,mysql)