title: Invalid operation at current cursor position. (Java Databases)
body: <p>I am running the following code to get data from database..</p>
  
  <pre><code>public String getCurrentSeason(String leagueName)
  {
      String qry = "Select * from KHAN.LeagueSeason where league_name = '"+leagueName+"'       AND end_Date IS NULL";
          try{
              ResultSet rs = stmt.executeQuery(qry);
  
              if(rs.next());
              {
                  String s = rs.getString(1);
                  return s;
              }
          }
          catch(SQLException err)
          {
              System.out.println(err.getMessage());
              System.exit(0);
          }
      return "";
  }
  </code></pre>
  
  <p>Although I'm using rs.next() but still it gives an error "Invalid operation at current cursor position.". Can somebody point out the error. I'm a beginner to java programming. Assuming connection and all other thing were intialized in the class constructor</p>