Hi Val,
Seems ResultSet#next() not fetching next page.
i tried the following snippet -
JdbcConnection conn =
(JdbcConnection)DriverManager.getConnection("<configuriation url>");
String sql = "select count from Test_counts where id is not null limit
1000";
PreparedStatement statement = conn.prepareStatement(sql);
statement.setMaxRows(100);
int i = 0;
ResultSet rs = statement.executeQuery();
while (rs.next() && i++ < 1000) {
System.out.println(rs.getString("count"));
}
i see only 100 records and 1000 is the expected records.
Do you see any issue with above snippet ? thanks
Thanks
On 3 December 2016 at 08:49, Anil <[email protected]> wrote:
> Hi Val,
>
> Thanks for clarification. I understand something and i will give a try.
>
> Thanks.
>
> On 2 December 2016 at 23:17, vkulichenko <[email protected]>
> wrote:
>
>> Anil,
>>
>> The JdbcQueryTask is executed each time the next page is needed. And the
>> number of rows returned by the task is limited by fetchSize:
>>
>> if (rows.size() == fetchSize) // If fetchSize is 0 then unlimited
>> break;
>>
>> The cursor is cached and reused there, so is this task is executed twice
>> for
>> the same result set, it will not execute the query from scratch, but will
>> get the existing cursor and start iteration from where it finished on the
>> first invocation.
>>
>> I'm not completely sure that I correctly understand what you mean by
>> streaming here, but paging is definitely in place and that's how it works
>> now.
>>
>> -Val
>>
>>
>>
>> --
>> View this message in context: http://apache-ignite-users.705
>> 18.x6.nabble.com/Fetching-large-number-of-records-tp9267p9373.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
>
>