前提:下面报错信息都是建立在 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 中端口号写错