我在做struts下的分页
数据库是sqlserver我的动态sql是
public static List getRecords(int startIndex) {
String sql = "SELECT TOP ? * FROM (SELECT TOP ? * FROM booktab) DERIVEDTBL ORDER BY bookid";
sqlNumber = "select count(*) from booktab";
return DBUtil.executeQuery(sql, startIndex, recordPerPage);
}填入值是:
private static void getResultSet(String sql, int startIndex, int count) throws
Exception {
getPreparedStatement(sql);
psta.setInt(1, startIndex);
psta.setInt(2, count);
res = psta.executeQuery();
}
可是总也不能显示记录来。
求各位大狭,关注下帮个忙。
数据库是sqlserver我的动态sql是
public static List getRecords(int startIndex) {
String sql = "SELECT TOP ? * FROM (SELECT TOP ? * FROM booktab) DERIVEDTBL ORDER BY bookid";
sqlNumber = "select count(*) from booktab";
return DBUtil.executeQuery(sql, startIndex, recordPerPage);
}填入值是:
private static void getResultSet(String sql, int startIndex, int count) throws
Exception {
getPreparedStatement(sql);
psta.setInt(1, startIndex);
psta.setInt(2, count);
res = psta.executeQuery();
}
可是总也不能显示记录来。
求各位大狭,关注下帮个忙。
解决方案 »
- 自己用java开发的植物大战僵尸联机版
- java 用文件流把数据写进一个vbs文件中,结果该文件无法执行
- delphi系统,现在要用java扩展功能
- 线程的问题
- 一句SQL查询语句,在JAVA中报错,在sqlserver中得到正确结果。
- 求教 myeclipse如何拖拽控件?
- tomcat不能编译jsp 急急急!!!
- java或者jsp里面可以根据链接的地址,保存网页吗?比如我要保存www.baidu.com/index.html我可以通过一个什么方法自动的保存呢(难点是在
- 来看看这个程序,人都快疯了!(急)
- 哪位有时间控件或者是Applet(能够在java Application中使用)
- 如何用java把String写入Excel,要求不同的String写在不同的方框内。在线等。
- JAVA的一道选择题,请大家帮忙看看~~
现在用hibernate方便多了
我想实现分页,郁闷的很。
只要能实现分页就好。
还有Hibernate的配置说明。
在线等。谢谢。
从哪来的
建议看看这个 http://dev.21tx.com/2003/07/18/10081.html我写的分页程序 就是参考上面这个例子的