@Autowired private JdbcTemplate jd;
int ps1=Integer.valueOf(pageSize); int cp1=Integer.valueOf(currPage);
StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append("SELECT * FROM (SELECT ROWNUM AS rowno, t.* FROM fhcb_08_tbl_ext_attributes t WHERE ROWNUM <="+cp1*ps1+" ) table_alias WHERE table_alias.rowno >= "+((cp1-1)*ps1+1)); List<Map<String, Object>> countList = jd .queryForList("SELECT COUNT(1) AS count FROM fhcb_08_tbl_ext_attributes"); count = Integer.parseInt(String.valueOf(countList.get(0).get("count"))); pageCount = (count % psize) == 0 ? count / psize : count / psize + 1; queryForList = jd.queryForList(stringBuffer.toString());