You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by John Chien <jo...@ncmail.net> on 2007/12/20 21:09:50 UTC
queryForList()
Question about :
public List queryForList(String statementName, Object parameterObject,
int skipResults, int maxResults) throws SQLException
Suppose I have a list of 1625 elements.
The first time I call using queryForList(statementName,
parameterObject, 0, 500) will give me the first 500 elements,
The second time I call using queryForList(statementName,
parameterObject, 500, 500) will give me the next 500 elements, (501 - 1000)
The third time I call using queryForList(statementName,
parameterObject, 1000, 500) will give me the next 500 elements, (1001 -
1500)
The fourth time I call using queryForList(statementName,
parameterObject, 1500, 500) will give me the next 125 elements, (1501 -
1625)
Am I correct about the use of it ?
Thanks,
John Chien
Re: queryForList()
Posted by Koka Kiknadze <22...@gmail.com>.
>
>
> It seems not give me what I expect as mentioned in the question.
>
Can not think of any explanation except that maybe you do not have an ORDER
BY clause in your select, so that each time you execute queryForList the
records are not returned in the same guaranteed order.
Re: queryForList()
Posted by John Chien <jo...@ncmail.net>.
Yes. That's the reason I am asking the question.
It seems not give me what I expect as mentioned in the question.
Larry Meadors wrote:
> Did you try it?
>
> Larry
>
>
> On Dec 20, 2007 1:09 PM, John Chien <jo...@ncmail.net> wrote:
>
>> Question about :
>>
>> public List queryForList(String statementName, Object parameterObject,
>> int skipResults, int maxResults) throws SQLException
>>
>> Suppose I have a list of 1625 elements.
>>
>> The first time I call using queryForList(statementName,
>> parameterObject, 0, 500) will give me the first 500 elements,
>> The second time I call using queryForList(statementName,
>> parameterObject, 500, 500) will give me the next 500 elements, (501 - 1000)
>> The third time I call using queryForList(statementName,
>> parameterObject, 1000, 500) will give me the next 500 elements, (1001 -
>> 1500)
>> The fourth time I call using queryForList(statementName,
>> parameterObject, 1500, 500) will give me the next 125 elements, (1501 -
>> 1625)
>>
>>
>> Am I correct about the use of it ?
>>
>> Thanks,
>>
>> John Chien
>>
>>
Re: queryForList()
Posted by Larry Meadors <lm...@apache.org>.
Did you try it?
Larry
On Dec 20, 2007 1:09 PM, John Chien <jo...@ncmail.net> wrote:
>
> Question about :
>
> public List queryForList(String statementName, Object parameterObject,
> int skipResults, int maxResults) throws SQLException
>
> Suppose I have a list of 1625 elements.
>
> The first time I call using queryForList(statementName,
> parameterObject, 0, 500) will give me the first 500 elements,
> The second time I call using queryForList(statementName,
> parameterObject, 500, 500) will give me the next 500 elements, (501 - 1000)
> The third time I call using queryForList(statementName,
> parameterObject, 1000, 500) will give me the next 500 elements, (1001 -
> 1500)
> The fourth time I call using queryForList(statementName,
> parameterObject, 1500, 500) will give me the next 125 elements, (1501 -
> 1625)
>
>
> Am I correct about the use of it ?
>
> Thanks,
>
> John Chien
>