Efficient way to go over result set in Java
<p>I am running a select command which returns 1,000,000 rows iterating over the ResultSet. The below code takes 5 minutes to execute.</p>

<p>Is there a faster way of iterating over a ResultSet?</p>

<pre><code>conn = getDbConnection();
Statement createStatement = conn.createStatement();
ResultSet rs = createStatement.executeQuery("Select * from myTable");
while (rs.next())
{
    //do nothing
}
</code></pre>

<p>Is there a way in java to make it more efficient while go over all the records in the result set.</p>

<p>Thanks</p>
