Receiver class com.mysql.jdbc.PreparedStatement does not define 连接数据库问题

来源:3-2 SQL 基本配置与执行

qq_鎖o鈊de鎡_03156283

2018-12-25 20:26

报错如下:应该是跟老师教程上的代码一致,不知是否遗漏了什么步骤
WARNING: An illegal reflective access operation has occurred

WARNING: Illegal reflective access by org.apache.ibatis.reflection.Reflector (file:/C:/Users/Administrator/eclipse-workspace/MicorMessage/WebContent/WEB-INF/lib/mybatis-3.4.6.jar) to method java.lang.Class.checkPackageAccess(java.lang.SecurityManager,java.lang.ClassLoader,boolean)

WARNING: Please consider reporting this to the maintainers of org.apache.ibatis.reflection.Reflector

WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations

WARNING: All illegal access operations will be denied in a future release

Exception in thread "main" java.lang.AbstractMethodError: Receiver class com.mysql.jdbc.PreparedStatement does not define or inherit an implementation of the resolved method abstract isClosed()Z of interface java.sql.Statement.

at org.apache.ibatis.executor.BaseExecutor.closeStatement(BaseExecutor.java:285)

at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:65)

at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:326)

at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)

at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)

at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:136)

at com.imooc.dao.MessageDao.queryMessageList(MessageDao.java:25)

at com.imooc.dao.MessageDao.main(MessageDao.java:84)


写回答 关注

1回答

  • 慕粉3818772
    2019-01-19 14:46:29

    是jar包的问题吗,可以再看看老师配置了哪些与MySQL相关的jar包

通过自动回复机器人学Mybatis---基础版

微信公众号自动回复功能学习Mybatis,基础教程加案例实战方式学习

107412 学习 · 786 问题

查看课程

相似问题