I am running a select command which returns 1,000,000 rows iterating over the ResultSet. The below code takes 5 minutes to execute.
Is there a faster way of iteratin
Make sure you're using pooled connections.
Using PreparedStatements could also have a possitive effect on performance.
(Though that probably won't save you several minutes.)
What are you doing with the data? Do you really need to load all that data at once?