ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 陈抒 <csfreeb...@gmail.com>
Subject Can't connect to Oracle DB when using rownum in iBatis3
Date Wed, 14 Apr 2010 06:01:55 GMT
Hello:
   I have a select statement  like so:
   <select id="getExemption" parameterType="freebird.
exemption.business.QueryCondition" resultMap="exemptionResultMap" >
        select exemption.id
,exemption.account_id,exemption.customer_id,exemption.customer_name,exemption.address1,exemption.address2,exemption.city,

exemption.state,exemption.country_code,exemption.zipcode,exemption.federal_id_type,exemption.federal_id,exemption.phone_number,exemption.email,

exemption.active,exemption_locations.country_code,exemption_locations.state_code,exemption_locations.reason_code,
        exemption_locations.permit_id,exemption_locations.start_date,
exemption_locations.end_date
        from exemption left join exemption_locations on exemption.id
=exemption_locations.exemption_id
        where exemption.account_id=#{accountId,jdbcType=VARCHAR}
        <if test="exemptionId!=null">
            and exemption.id=#{exemptionId,jdbcType=INTEGER}
        </if>
        <if test="customerId!=null">
            and exemption.customer_id=#{customerId,jdbcType=VARCHAR}
        </if>
        and rownum <= #{maxCount} order by id
    </select>
   I can't connect to my Oracle DB through SqlSessionFactory.openSession(),a
NullPointerExeption object was thrown out.
   When I remove the above red words,it works.Why?I think my select
statement is correct,because I tested in Oracle.
   I also tried 'and rownum<=1000',but still failed.


陈抒
Best regards
http://blog.csdn.net/sheismylife

Mime
View raw message