java.sql.SQLException: Illegal operation on empty result set. when authenticating

后端 未结 2 1177
盖世英雄少女心
盖世英雄少女心 2021-01-15 11:00

What I\'m trying to do is:

  1. Accept username(uname) and password(passw) as an input from the user.

  2. Using ResultSet, retrieve the

2条回答
  •  自闭症患者
    2021-01-15 11:38

    You are supposed to use the result of rs.next() :

                if (rs.next()) {
                    n=rs.getString("id");
                    m=rs.getString("pass");
                }
    

    If rs.next() returns false, this means the query returned no rows.

提交回复
热议问题