Hi,
This is the problem I have.
...
String name = req.getParameter("LoginNmae");
tring passwd = req.getParameter("passwd");
...
..
rs=stmt1.executeQuery("select loginname,password from lecturer where
loginname='"+name+"'");
rs.next();
String temppass;
String tempuser=rs.getString("loginname");
if(rs.wasNull()){
out.println(" Still You are not a Registered member ");
out.println("You may want to <A HREF=\"http://localhost:7070/rw\">Reigister
first</A>");
...
else //else routine
...
....
The code is basically a part of authentication code.It gets the username and
password from the user and check whether he/she is a valid member.
Before enter into the system they(users) have to be registered.
The above code works for the following two situations
1)user enters correct password and correct username
2)user enters invalid password and corrext username(it rejects the user
properly)
The above two works since it comes under else routine.
But the problem is if he enters the invalid username(which is not in the
database) it gives an Exception "Invalid Cursor state".
In the above code I did not use an While(rs.next()) since there can be one
user name for a given user.(the rs should contain one entry)
How can I check the above that is when there are no loginname which match to
his loginname.
thanks
lalith
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html