title: Java JDBC First () in ResultSet is not working?
body: <p>I want to change the position of the cursor to the first row but I don't know why my code is not working.when I add <code>rs2.first()</code>:</p>
  <p>and also I am getting this error :</p>
  <p>This method should only be called on ResultSet objects that are scrollable (type TYPE_SCROLL_INSENSITIVE).</p>
  <pre><code>        try{                    
        String driver = &quot;org.apache.derby.jdbc.ClientDriver&quot;;
        Class.forName(driver).newInstance();
        String url = &quot;jdbc:derby://localhost:1527/test&quot;;
        Connection conn = DriverManager.getConnection(url);
        String query = &quot;select * from APP.RANKING&quot;;
        Statement stmt = conn.createStatement();
        Statement stmt2 = conn.createStatement();
        ResultSet rs = stmt.executeQuery(query);
        ResultSet rs2 = stmt2.executeQuery(query);
        while (rs.next()){             
            String BID = rs.getString(&quot;BALLOT_ID&quot;);
            String CN = rs.getString(&quot;CANDIDATE_NAME&quot;);
            String ROID = rs.getString(&quot;USER_ID&quot;);
            Ro1_ID = ROID;
            String RA = rs.getString(&quot;RANK&quot;);
            int rowNum = rs.getRow();
            int rowNum2;
            boolean In_check = false;
            while(rs2.next()){               
                    In_ballot.addElement(BID);  
                    
                  }
  
            rs2.First();
            In_ballot.addElement(BID);  
                }
           
           }
      catch(Throwable e) {
                  System.err.println(e.getMessage());        
                  }
      this.InB_list.setModel(In_ballot);
  </code></pre>