-1

How to get first 40 records from table , where i am using resultset in java and is that possible to get first 40 and next 40 and etc, where i am not using paggination.

4

3 に答える 3

0

I think it's not a good idea to extract some records from result set from performance perspective as it will load entire table data everytime. It will be good if you fire the pagination queries to load only required data (syntax is dependent on database e.g MySql provides Limit clause).

于 2012-06-09T05:30:28.940 に答える
0

Not sure what exactly your question is. But if I understand you correctly, you need to get only 40 records from the DB at a time, and fetch batches of 40 records each, as and when needed.

If above is true, then you can use CachedRowSet. In this, you can set the size of the batch using setPageSize().

If this is not what you want, please add more explanation to your question.

于 2012-06-09T05:32:24.220 に答える
0

I think You are looking for pagination and every page contains 40 data item.

Query would be like -

select *
 from
  ( select rownum rnm, a.*
     from (your_query) a
     where rownum <= :M )
 where rnm >= :N;
于 2012-06-09T07:23:04.153 に答える