tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uma Maheswar" <h...@globalleafs.com>
Subject Checking with DB
Date Sat, 23 Feb 2002 04:39:45 GMT
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();
  }
 }
}


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message