title: Why ResultSet's index in Java Starts with '1' instead of zero?
body: <p>I am trying to access index 0 in ResultSet but I am getting exception</p>
  
  <pre><code> java.sql.SQLException: Column Index out of range, 0 &lt; 1.
  </code></pre>
  
  <p><strong>Code :</strong></p>
  
  <pre><code>c = db.getConnection();
  
  String prefQuery = "SELECT pLab from practicals where className = ? AND pFacName = ?";
  PreparedStatement stPref = c.prepareStatement(prefQuery);
  stPref.setString(1, className);
  stPref.setString(2, facName);
  ResultSet rsPref = stPref.executeQuery();
  
  while (rsPref.next()){
      MainClass.show(rsPref.getString(0));
  }
  </code></pre>