ResultSet.TYPE_FORWARD_ONLY in Java
<pre><code> try {

        Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/employee", "root", "root");
        String query = "select * from sample;";
        Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        stmt.executeQuery(query);
        ResultSet rs = stmt.getResultSet();
        rs.absolute(3);

        while (rs.next()) {
            System.out.println(rs.getString("name"));
        }
            rs.beforeFirst();
            while (rs.next()) {
            System.out.println(rs.getString("name"));
        }

 while (rs.previous()) {
            System.out.println(rs.getString("name"));
        }
    } catch (Exception ex) {
        ex.printStackTrace();
    }
</code></pre>

<p>This is working fine.
Here <code>ResultSet</code> is <code>TYPE_FORWARD_ONLY</code> but i can go in previous direction also. 
Can anyone explain me that, i googled it but could not get any satisfactory answers.</p>
