在用mybatis的分页插件时出现了java.lang.NoSuchMethodException:org.apache.ibatis.executor.statement.StatementHandler.prepare(java.sql.Connection)的错误。
通过在网上查找原来是我用的mybati3.4.0版本的StatementHandler的prepare方法做了修改。Statement prepare(Connection connection, Integer transactionTimeout) throws SQLException;
所以将@Intercepts({@Signature(type=StatementHandler.class,method=”prepare”,args={Connection.class})})改为@Intercepts({@Signature(type=StatementHandler.class,method=”prepare”,args={Connection.class, Integer.class})})就好了。或者用低版本的mybatis。
非常感谢这篇文章的讲解https://blog.csdn.net/zsq520520/article/details/69666734
【MyBatis】org.apache.ibatis.executor.statement.StatementHandler.prepare(java.sql.Connection)
最新推荐文章于 2024-03-06 17:48:32 发布