Keith,
Instead of
correctpass = rs.getString("USER_PASS");
try putting
correctpass = rs.getString(1);
or
correctpass = rs.getString(2);
etc.
depending on the position of the USER_PASS Column in you table
Regards,
Mo.
Mohammad Sahirad
Merrill Lynch Swaps Technology
RMP-06-05
6A Ropemaker
25 Ropemaker Street
London EC2Y 9LY
+44 (0)171 867 4925
> -----Original Message-----
> From: Keith Ball [SMTP:[EMAIL PROTECTED]]
> Sent: 08 October 1999 16:35
> To: [EMAIL PROTECTED]
> Subject: JDBC Problem in my servlet.....
>
> Here is my code for my servlet which goes to a database and checks to see
> if the password has been entered correctly.
>
>
> String query = "SELECT * FROM USERS WHERE USER_USERNAME = '" + username +
> "'";
>
> ResultSet rs = stmt.executeQuery(query);
>
> while (rs.next()) {
> correctpass = rs.getString("USER_PASS");
> }
>
> if(correctpass.equals(password))
> {
> iscorrect = true;
> } else {
> iscorrect = false;
> }
>
> return iscorrect;
>
> Correctpass results in a NULL. This code works fine when I run it as a
> application. Is there some sort of security issue, I dont know about ? I
> thought that servlets worked on the same security system as applications.
>
> Thnx for the help in advance.
>
> Keith
> --------------------------------------------------------------------------
> -
> Keith Ball - Praktikant
> AF12 Operationelle Analysen Luftwaffe
> IABG MbH Einsteinstr. 20 85521 Ottobrunn
> Phone : 0049-89-6088-2556
> Email : [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> WWW
> site : www.iabg.de <http://www.iabg.de>
> --------------------------------------------------------------------------
> --
>
___________________________________________________________________________
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