int currentPage = 1 ; // 为当前所在的页,默认在第1页
int lineSize = 3 ; // 每次显示的记录数
int allRecorders = 0 ; // 表示全部的记录数
int pageSize = 1 ; // 表示全部的页数(尾页)
int lsData[] = {1,3,5,7,9,10,15,20,25,30,50,100} ;
sql = "SELECT * FROM ( " +
" SELECT empno,ename,job,hiredate,sal,comm,ROWNUM rn " +
" FROM emp WHERE ROWNUM<=? ORDER BY empno) temp " +
" WHERE temp.rn>? " ;
pstmt = conn.prepareStatement(sql) ;
pstmt.setInt(1,currentPage * lineSize) ;
pstmt.setInt(2,(currentPage-1) * lineSize) ;
rs = pstmt.executeQuery() ;
请各位大侠用sql语言写出来 |
|