jsp中cannot be resolved
<formmethod="POST"action="login.jsp"><%//是否登陆if((String)session.getValue("user_name")...
<form method="POST" action="login.jsp">
<%
//是否登陆
if((String)session.getValue("user_name")!=null)
{
String name=(String)session.getAttribute("user_name");
String sql="select * from member where user_name='"+name+"'";
//ResultSet rs=null;
rs=stmt.executeQuery(sql);
if(rs.next()){
%>
。。。。。。
所有的rs都有问题:
rs cannot be resolved to a variable
stmt cannot be resolved 展开
<%
//是否登陆
if((String)session.getValue("user_name")!=null)
{
String name=(String)session.getAttribute("user_name");
String sql="select * from member where user_name='"+name+"'";
//ResultSet rs=null;
rs=stmt.executeQuery(sql);
if(rs.next()){
%>
。。。。。。
所有的rs都有问题:
rs cannot be resolved to a variable
stmt cannot be resolved 展开
若以下回答无法解决问题,邀请你更新回答
1个回答
展开全部
改成
<form method="POST" action="login.jsp">
<%
//是否登陆
String usr=(String)session.getValue("user_name");
if(usr!=null && !usr.equals(""))
{
String name=(String)session.getAttribute("user_name");
String sql="select * from member where user_name='"+name+"'";
//ResultSet rs=null;
rs=stmt.executeQuery(sql);
if(rs.next()){
%>
<form method="POST" action="login.jsp">
<%
//是否登陆
String usr=(String)session.getValue("user_name");
if(usr!=null && !usr.equals(""))
{
String name=(String)session.getAttribute("user_name");
String sql="select * from member where user_name='"+name+"'";
//ResultSet rs=null;
rs=stmt.executeQuery(sql);
if(rs.next()){
%>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |