当前位置: 技术问答>java相关
这样sql查询在jsp中如何写?
来源: 互联网 发布时间:2015-01-20
本文导语: 我要将userid,password作为查询条件在jsp中应该如何写,是这样吗: String Userid=request.getParameter("userid"); String Password=request.getParameter("password"); ... rs_user=state.executeQuery("select * from userInfo where user_i...
我要将userid,password作为查询条件在jsp中应该如何写,是这样吗:
String Userid=request.getParameter("userid");
String Password=request.getParameter("password");
...
rs_user=state.executeQuery("select * from userInfo where user_id=Userid and password=Password order by user_id")
我知道不对啦,我想要个正确答案
String Userid=request.getParameter("userid");
String Password=request.getParameter("password");
...
rs_user=state.executeQuery("select * from userInfo where user_id=Userid and password=Password order by user_id")
我知道不对啦,我想要个正确答案
|
state.executeQuery("select * from userInfo where user_id='" + Userid + "' and password='" + Password + "' order by user_id")