Results 1 to 2 of 2
  1. #1
    richteri is offline Member
    Join Date
    Jan 2010
    Posts
    4
    Rep Power
    0

    Default Empty result set with dynamic query and row handler in iBATIS

    Hi,

    I'm trying to use the queryWithRowHandler method of iBATIS SqlClientTemplate, but the statement
    is returning empty ResultSet and the handleRow method of rowHandler
    is not called.

    The generated statements are returning at least one row if run manually.

    iBatis XML:
    Java Code:
    <select id="queryId" parameterClass="map" remapResults="true"> 
       SELECT  
       <iterate property="fields" conjunction=","> $fields[]$</iterate>, COUNT(1) as pages 
       FROM aTable 
           LEFT JOIN otherTable ON (...) 
           WHERE ... 
       GROUP BY <iterate property="fields" conjunction=","> $fields[]$</iterate> 
    </select>

    JAVA
    Java Code:
    DynamicStatModelRowHandler rowHandler = new DynamicStatModelRowHandler(fields); 
    getSqlMapClientTemplate().queryWithRowHandler("queryStat", param, rowHandler); 
    return rowHandler.getStats();

    VERSIONS:
    Spring Framework 2.5.6, Ibatis 2.3.4.726, Oracle XE 10g

    Any help is much appreciated.

  2. #2
    richteri is offline Member
    Join Date
    Jan 2010
    Posts
    4
    Rep Power
    0

    Default

    Thanks, putting resultClass="java.util.HashMap" into the opening select tag helped.

Similar Threads

  1. Mysql dynamic query, Java and Jasper report
    By rajuchacha007 in forum Advanced Java
    Replies: 5
    Last Post: 06-28-2010, 11:32 AM
  2. column result query
    By vikashkumar in forum JDBC
    Replies: 0
    Last Post: 04-03-2009, 03:23 PM
  3. Help!! how to turn query result to string
    By stefanybaez in forum Advanced Java
    Replies: 2
    Last Post: 12-11-2008, 12:42 PM
  4. Raising alerts based on query result across the network
    By srinivasan.sr in forum Networking
    Replies: 2
    Last Post: 07-22-2008, 07:47 AM
  5. Export query result, procces is to slow
    By Daniel in forum Enterprise JavaBeans (EJB)
    Replies: 2
    Last Post: 06-28-2007, 07:35 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •