dimanche 6 décembre 2015

If, Else statement trouble (Java) [duplicate]

This question already has an answer here:

I am having problem displaying some text and opening a new class. I can only seem to do one, but not both, otherwise I get an error at the Else saying 'else without if'. I have to // either the println or app.loginOption, as i cannot have both without an error occuring. Thanks for any help

    ResultSet rs = st.executeQuery("SELECT username, password from register WHERE username ='" + username + "' and password = '" + password + "'");
        if(rs.next())
            Apps.loginOptions();
            //System.out.println("Login successful! " );

        else
            System.out.println("Username or login not found. Please try again: ");

Aucun commentaire:

Enregistrer un commentaire