Hi,
Please help me with this. Please see the code below. It doesn't work, if I give the
correct id and password.But it works if I say (!rs.next()). The same type of programme
worked for me in case of other tables. Could any one pls help me solve this problem.
String id = req.getParameter("userid");
String pwd = req.getParameter("password");
ServletOutputStream sos = res.getOutputStream();
rs = st.executeQuery("select * from uma where userid='"+user+"' and
password='"+pwd+"' ");
sos.println("<html><body bgcolor=lightyellow>");
if(rs.next())
{
sos.println("you are lucky");
sos.println("<input type='submit' value='Submit' name='submit'></p>");
}
else
{
sos.println("<h2>Get out of my site</h2>");
}
sos.println("</body></html>");
}
catch(Exception e)
{
e.printStackTrace();
}
}
}