org.apache.ibatis.exceptions.PersistenceException:Error querying database.

报错信息:

org.apache.ibatis.exceptions.PersistenceException:

Error querying database.  

Cause: org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'UserMapperNS.getAll'.  It's likely that neither a Result Type nor a Result Map was specified.

原因:

        写SQL语句的mapper文件里,有些地方没有写resultType="",导致程序执行完SQL语句后,不知道以什么类型返回数据,如下图

org.apache.ibatis.exceptions.PersistenceException:Error querying database._第1张图片

 

你可能感兴趣的:(Spring项目异常处理,数据库,mybatis)