jsp中如何获取数据库语句的参数
我的前页当中有<%=_rs.getString("username")%>,我想在showrz.jsp里获取username这个参数,我用Stringname=reque...
我的前页当中有<%=_rs.getString("username")%>,我想在showrz.jsp里获取username这个参数,我用String name = request.getParameter("username")时候会出现以下错误:An
error occurred at line: 5 in the jsp file: /jsrz/admin/showrz.jsp
stmt cannot be resolved
2: <%@ include file="../incoming/common.jsp"%>
3: <%@ include file="../incoming/connectdb.jsp"%>
4: <table width="438" align="center">
5: <%
6: String name = request.getParameter("username");
7: sql="select * from rzbody where name='"+name+"'";
8: rs=stmt.executeQuery(sql);//查询数据库
我用的是不同的数据库表,也就是说两个数据库表中都有username这个参数。
O0O0OO000O0OOO
能否说说具体操作 展开
error occurred at line: 5 in the jsp file: /jsrz/admin/showrz.jsp
stmt cannot be resolved
2: <%@ include file="../incoming/common.jsp"%>
3: <%@ include file="../incoming/connectdb.jsp"%>
4: <table width="438" align="center">
5: <%
6: String name = request.getParameter("username");
7: sql="select * from rzbody where name='"+name+"'";
8: rs=stmt.executeQuery(sql);//查询数据库
我用的是不同的数据库表,也就是说两个数据库表中都有username这个参数。
O0O0OO000O0OOO
能否说说具体操作 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询