求高手写一个用jsp实现调用sql分页存储过程实现分页

q465897859 2012-03-16 10:28:51
http://download.csdn.net/detail/q465897859/4145343
传送门 sql库在这个里面 存储过程也写好了
求各位大大帮忙 本人新手菜鸟 求例子 不胜感激!!
...全文
231 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
q465897859 2012-03-19
  • 打赏
  • 举报
回复
whb9413 2012-03-17
  • 打赏
  • 举报
回复
你要的资源不存在。。。。现在现实中小偷已经升级到网上偷了。。。
dryZeng 2012-03-16
  • 打赏
  • 举报
回复
这个,,,没时间给你写啊。路过,顺便帮你顶一下吧。
q465897859 2012-03-16
  • 打赏
  • 举报
回复
在自己顶 gly 你妹的sb 删毛啊
zuxianghuang 2012-03-16
  • 打赏
  • 举报
回复
用存储过程分页不怎么好用,
除非你就对一个表,

感觉还是java 写方法好
新手学堂 2012-03-16
  • 打赏
  • 举报
回复
/**
* 分页查询
* @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;
}
}
q465897859 2012-03-16
  • 打赏
  • 举报
回复
继续传 坐等贼人再偷
q465897859 2012-03-16
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 bill0605030109 的回复:]
兔子。你搜索的资源不存在嘢。。
[/Quote]我靠坑爹呀
肿么没了 被谁偷了
crazyyujie 2012-03-16
  • 打赏
  • 举报
回复
存储过程 没写过。
sql语句到写过。
  • 打赏
  • 举报
回复
兔子。你搜索的资源不存在嘢。。
q465897859 2012-03-16
  • 打赏
  • 举报
回复
怎么木有人啊
q465897859 2012-03-16
  • 打赏
  • 举报
回复

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧