现在我的这个分页要实现查询功能。
sql语句要传递参数,新的sql语句如下:
tablename = [当前需要查询的表];
begindate = [起始时间];
enddate = [结束时间];
str = " select * from " + tablename + " where username = '" + username + "' and (crtime between to_date('" + begindate + "','yyyy-mm-dd') and to_date('" + enddate + "','yyyy-mm-dd')) order by crtime desc ";
sql = "select * FROM ( SELECT A.*, ROWNUM RN FROM ("+ str +") A WHERE ROWNUM <= "+ currentPage* pageSize+") WHERE RN >= " + i;sql语句这样的改变后,分页效果不能实现。
据说是,sql语句这样的参数传递需要用js来实现,小弟疏于此道,还望各位老兄指教一二。