title: java.sql.SLQException: Illegal operation on empty result set
body: <p>I got a login system in java and i want to get de user, password and type of user from database. But when i run the programe i got the folowing error: java.sql.SLQException: Illegal operation on empty result set
  Code:</p>
  
  <pre><code>    conn=MysqlConnect.ConnectDB();
      String Sql="Select*from utilizador where Nome='" + Username +"' and Password='" + Password +"' and Permissao'" + Permissao + "'" ;
  
      try{
          pst=conn.prepareStatement(Sql);
          Statement st = conn.createStatement();
          ResultSet rs = st.executeQuery(Sql);
          int permissao = rs.getInt("Permissao");
          String nome = rs.getString("Nome");
          String password = rs.getString("Password");
  
          if(rs.next()){
  </code></pre>