title: How to create a scrollable ResultSet?
body: <p>I got this simple code to retrieve a recordset from a MSSQL Server 2008 which has to be scrollable due to the fact that I set the ResultSet.TYPE_SCROLL_INSENSITVE, same as the example from the Javadocs:</p>
  
  <pre><code>String qry = "SELECT * from tblPeople";
  SQLConnection sql = new SQLConnection();
  Statement stmt = sql.getConnection().createStatement(
                                          ResultSet.TYPE_SCROLL_INSENSITIVE,
                                          ResultSet.CONCUR_UPDATABLE);
  ResultSet rs = stmt.executeQuery(qry);
  </code></pre>
  
  <p>Unfortunately I still got this Stack Trace when I want to get the row count like <code>rs.last(); int rowCount = rs.getRow();</code>:</p>
  
  <pre><code>java.sql.SQLException: ResultSet may only be accessed in a forward direction.
      at net.sourceforge.jtds.jdbc.JtdsResultSet.checkScrollable(JtdsResultSet.java:304)
      at net.sourceforge.jtds.jdbc.JtdsResultSet.last(JtdsResultSet.java:551)
      at test.personen.Main.main(Main.java:44)
  </code></pre>
  
  <p>Why is that and how can I fix it (by the way, when I check the Type of the ResultSet, I get 1003..)?</p>