Hi,
I'm trying to check the login.
The values of id and pw are send from a textbox and the values of userid and password are from a mysql database. I try to compare them and if they are equal i want to return true and else return false. But i always get the missing return statement error.
And if I put my return somewhere else i get the unreachable statement error. Can someone help me?

  public Boolean CheckLogin(int id, String pw) 
    {  [B]// missing return statement error [/B] 
       try
       {   
        int userid = 0;
        String password = "";
        ResultSet rs = null;
        rs = KrijgLogin.executeQuery();
        userid = rs.getInt("userid");
        password = rs.getString("wachtwoord");
        if (userid == id && wachtwoord.equals(pw))
        {
            return true;
        }
        else 
        {
            return false;
        }
         } catch (SQLException ex) {

         }    
    }

Edited 3 Years Ago by Nick Evan: Fixed formatting

In case there is an error, there is no return from your catch statement...

Edited 3 Years Ago by Nick Evan: Fixed formatting

catch (SQLException ex) {
return false;
}

Add this and try again. As ur catch exception dont have return thats y u are encountering this error.

This question has already been answered. Start a new discussion instead.