日期:2014-05-17  浏览次数:20661 次

求高手写一个用jsp实现调用sql分页存储过程实现分页
http://download.csdn.net/detail/q465897859/4145343
传送门 sql库在这个里面 存储过程也写好了  
求各位大大帮忙 本人新手菜鸟 求例子 不胜感激!!

------解决方案--------------------
这个,,,没时间给你写啊。路过,顺便帮你顶一下吧。
------解决方案--------------------
兔子。你搜索的资源不存在嘢。。
------解决方案--------------------
存储过程 没写过。
sql语句到写过。
------解决方案--------------------
/**
* 分页查询
* @param sql
* @param page
* @param pageSize
* @return
*/
public ResultSet queryBypage(String sql,int page,int pageSize){
rs=null;
try {
int begin=(page-1)*pageSize;
sql+="limit"+begin+","+pageSize;
rs=query(sql);
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
return rs;
}
/**
* 查询总记录数
* @param sql
* @return
*/
public int getRecordCount(String sql){
int Count=0;
try {
sql="select count(*)"+sql.substring(sql.indexOf("from"));
rs=query(sql);
rs.next();
Count=rs.getInt(1);
rs.close();
rs=null;
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
return Count;
}
/**
* 总页数
* @param sql
* @param pageSize
* @return
*/
public int getPageTotal(String sql,int pageSize){
int total=0;
int Count=this.getRecordCount(sql);
total=Count%pageSize==0?(Count/pageSize):(Count/pageSize+1);
return total;
}
}

------解决方案--------------------
用存储过程分页不怎么好用,
除非你就对一个表,

感觉还是java 写方法好
------解决方案--------------------
你要的资源不存在。。。。现在现实中小偷已经升级到网上偷了。。。