Three suggestions.
- As @Luiggi Mendoza writes as a comment, initialize your List with a large initial buffer, so it isn't reallocating and copying all day.
- Depending on your DB and JDBC driver, you may get a speedup with
ps.setFetchSize(50000);
(Play around with constant.) If your fetch size is small you are doing a lot of I-want-more round-trips to your server. - Don't guess which step is the bottleneck; use a profiler.