读书人

Ibatis查询为空解决方案

发布时间: 2012-01-11 22:28:46 作者: rapoo

Ibatis查询为空
SQL

XML code
    <!-- 根据code检测记录是否存在 -->    <select id="checkByCode" parameterClass="java.lang.String" resultClass="int">      select  count(1) from class  t where t.code=#code# and t.flag=1    </select>

DAO
XML code
    /**     *根据code查询记录是否存在     *     *@param  String     *@return boolean     * */    public boolean checkIsExistByCode(String code);


DAOImpl
Java code
    /**     *根据code查询记录是否存在     *     *@param  String     *@return boolean     * */    public boolean checkIsExistByCode(String code){        return (Integer)sqlClient.queryForObject("checkByCode",code)==0?false:true;    }


问题DAOImpl 报空指针sqlClient.queryForObject("checkByCode",code)查询是null
但我用后台打出来的sql和参数 在plsql中可以查到值

[解决办法]
自己再调一调吧,从你给的信息业看不出什么来
[解决办法]
你随便换图sql语句看看吧。。感觉实现类没问题啊。

读书人网 >J2EE开发

热点推荐