IDEA+mybatis+MySQL 用户登录,报错信息及其解决办法

前提:下面报错信息都是建立在 mybatis 和 mysql 已经正常连接基础之上

bug1:Exception in thread "main" org.apache.ibatis.builder.IncompleteElementException: Could not find result map com.xxxx.entity.User

solution:Mapper.xml 文件中 select 标签中的结果集使用 resultMap 进行返回,改成 resultType 即可

 

 

 

改完 bug1 后出现 bug2:

Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

solution:mysql.properties 中端口号写错

 

posted @ 2020-12-07 13:58  快走中的擦边球  阅读(153)  评论(0编辑  收藏  举报