jsp将查询出来的数据分页显示,点击下一页就出现jdbc.SQLServerException: 结果集没有当前行,主要如下: 20
<%Stringxq=request.getParameter("xq");stmt=con.createStatement(ResultSet.TYPE_SCROLL_...
<%String xq=request.getParameter("xq");
stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY;
String sql="select 身份证号,姓名,性别,校区 from info where 校区='"+xq+"'";
<div style=" height:50px; position: relative; left: 0px; top: 400px;">
<p align="left" >
共<%=totalItem%>个记录,分<%=totalPage%>页显示,当前页是:第<%=curPage%>页<br /></br>
<%if(curPage>1){%><a href="lookxq2.jsp?page=1">首页</a><%}%>
<%if(curPage>1){%><a href="lookxq2.jsp?page=<%=curPage-1%>">上一页</a><%}%>
<%
for(int j=1;j<=totalPage;j++)
{
out.print(" <a href='lookxq2.jsp?page="+j+"'>"+j+"</a>");
}
%>
<%if(curPage<totalPage){%><a href="lookxq2.jsp?page=<%=curPage+1%>&& xq=<%=request.getParameter("xq")%>">下一页</a><
%}%>
<%if(totalPage>1){%><a href="lookxq2.jsp?page=<%=totalPage%>">末页</a><%}%>
<%
}
catch(SQLException e1){out.println(e1);}
%>
<div> 展开
stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY;
String sql="select 身份证号,姓名,性别,校区 from info where 校区='"+xq+"'";
<div style=" height:50px; position: relative; left: 0px; top: 400px;">
<p align="left" >
共<%=totalItem%>个记录,分<%=totalPage%>页显示,当前页是:第<%=curPage%>页<br /></br>
<%if(curPage>1){%><a href="lookxq2.jsp?page=1">首页</a><%}%>
<%if(curPage>1){%><a href="lookxq2.jsp?page=<%=curPage-1%>">上一页</a><%}%>
<%
for(int j=1;j<=totalPage;j++)
{
out.print(" <a href='lookxq2.jsp?page="+j+"'>"+j+"</a>");
}
%>
<%if(curPage<totalPage){%><a href="lookxq2.jsp?page=<%=curPage+1%>&& xq=<%=request.getParameter("xq")%>">下一页</a><
%}%>
<%if(totalPage>1){%><a href="lookxq2.jsp?page=<%=totalPage%>">末页</a><%}%>
<%
}
catch(SQLException e1){out.println(e1);}
%>
<div> 展开
展开全部
<a href="lookxq2.jsp?page=<%=curPage+1%>&& xq=<%=request.getParameter("xq")%>">下一页</a>
&&多了一个,修改为如下代码试试:
<a href="lookxq2.jsp?page=<%=curPage+1%>& xq=<%=request.getParameter("xq")%>">下一页</a>
追问
不行啊 一个&和两个一样效果啊~~~郁闷 2天了还没找到问题到底是出在哪~~~
追答
还没搞定?把详细的错误log贴出来看看
加一行调试代码看看xq的值是否传递成功。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询