Hi all,
I'm doing a Username/password validation against Sybase database.
When the user enters the details i check for the values in the database and if it dosen't match i redirect to login page.
I got the result set from the query and i check if the username/password entered exists in the database...
login.jsp:::
 
id = request.getParameter("username");  
   pin = request.getParameter("password");
if (loginBean.UserExists(id,pin) == true) {
     session.setAttribute("user", id);
     monitor.put(id, session);
     System.out.println("************Assigned new session for: " + id);
     session.setMaxInactiveInterval(900);
     display = "control.jsp?";
  }
  else{
     display = "showLogin.html"; 
  }
%>
<jsp:forward page="<%= display %>"/>
 
Login.java:::
 
while(myResultSet.next()){
    String uid = myResultSet.getString("UserLoginId");
    String upin = myResultSet.getString("UserPassword");
   
     if ((username.equals(uid)) && (password.equals(upin))){
      validUser = true;
    }
   }
 
When i debug i find that ""if ((username.equals(uid)) && (password.equals(upin)))"" dosen't execute...That means i'm doing a mistake in that code...
Can someone help me with this....
 
Thanks
Praveen

Reply via email to