아래와 같이 SQL로 조회 시 부터 페이징 처리해서 조회하여야 깔끔~
1. Bind Parameter (바인딩 패라미터)
- :fetchSize : Row count of 1 transaction fetching
- :fetchPage: Number page you want.
2. Query Statement (오라클 기준 Query)
/* PAGING-HEAD */
SELECT * FROM ( SELECT * FROM ROWNUM RN, DAT.* FROM (
/* START-BODY */
SELECT 1 COL1 FROM DUAL UNION ALL
SELECT 2 COL2 FROM DUAL UNION ALL
SELECT 3 COL3 FROM DUAL UNION ALL
SELECT 4 COL4 FROM DUAL
/* END-BODY */
/* PAGING-FOOT */
) DAT WHERE ROWNUM <= (:fetchSize * fetchPage) ) WHERE RN > :fetchSize * (fetchPage -1))
댓글 없음:
댓글 쓰기