Reputation: 11001
This nice article about pagination with Apache iBatis SqlMaps states that iBatis does physical pagination using database cursor if available using ResultSet.absolute(position) if we call the queryForList API as in the example:
final List<product> queryForList = sqlMapClient.queryForList("SELECT",
parameter, paginationContext.getSkipResults(),
paginationContext.getMaxResults());
In the case in which the DataSource consists of an Oracle 11g connected via jdbc (ojdbc6.jar) what exactly does that mean?
Does iBatis change somehow the query statement sent to Oracle to handle the paging? Can I be sure that only the records for data pages required are transferred from the database to the application? how it works behind the scenes?
Upvotes: 2
Views: 2017
Reputation: 21
@ibatis First determine whether the database supports the rs.absolute(seekPosion)
method, it will take out all the record and filter from records.
For large data retrieval, it is not recommend that you do it this way, instead you should utilize the pagination from the database instead.
MySQL:
limit offset,maxSize
Oracle:
select B.* from (select b.*,rownum as linenum from A b where rownum>offset) B where B.linenum<mazSize;
Upvotes: 2