ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Chien <john.ch...@ncmail.net>
Subject queryForList()
Date Fri, 17 Oct 2008 15:01:53 GMT

Dear Sir:

I used the SQLMAP' s API queryForList to get data back from database.
There are many data in database, so I the one that has four input 
parameters.
The SQLMAP XML syntax should return me 10198 records, if runs without loop.
I have already tested this by plugin the values.

However, I have it runs in loop and bring back 500 records every time.
It should run 21 times. However, it returns null at the 12 loops (very 
consistently. I try many times)
I am wondering what might be the problem.

Thanks,

John Chien

Following is my code:
************************************************************************************************
   ArrayList list = null;
   int skipCount = 0;
   int maxCount = 500;
   boolean done = false;
   int facilityCount = 0;
      
   while (! done) {
        list = (ArrayList) 
getSqlMapClientTemplate().queryForList("getIIBillableFacilityList", 
formBean, skipCount, maxCount);
        if ((list != null) && (list.size() > 0)) {
            for (int i = 0; i < list.size(); i++) {
                  FacilityNameAddressBean facility = 
(FacilityNameAddressBean) list.get(i);
                  insertFirstBillingRecord(formBean, facility.getId(), 
userId);
                 
                  facilityCount++;
               }
               skipCount += list.size();
              
               if (list.size() < maxCount) {
                   done = true;
               }
           } else {
               done = true;
           }
       }
}

****************************************************************************************************


Mime
View raw message