数据库编程异常汇集

一、Exception title:column 'XXXX' in field list is ambiguous

原因:表中包含共同字段'xxxx'
如:select name from a,b where a.id=b.id    因为a、b表里都有name字段
解决:字段前加上具体表名,如: select a.name from a,b where a.id=b.id

二、Exception title: 

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.cisetech.emp.dal.mapper.WxTokenMapper.queryByID
原因:WxTokenMapper.java类中定义了queryByID方法,而mybatis的映射xml文件中没有找到对应的方法,所以就会报这个异常。
解决办法:分析,这种情况一般是方法有写了,只是和java类对应的方法名有出入,从而会找不到,一般修改过来就可以了。
原文地址:https://www.cnblogs.com/outpointexception/p/5242705.html