I'm getting about 15k rows from an Access 2003 database using the jdbc odbc driver but when I iterate over my resultset, it's taking about 40 seconds (although spikes to almost 2 minutes in some cases). I'm just wondering if this is a reasonable number to expect for a resultset of this size, and if so, is there any way to optimize this?
My query is a very simple 'select field1, field2...from table1' type of query, so I don't imagine it could be made any more efficient. Here's the code I'm using to get my local disconnected version of the resultset:
while (rs.next()) {
item = new HashMap<String, Object>();
for (int i = 1; i <= metadata.getColumnCount(); i++) {
item.put(metadata.getColumnName(i), rs.getObject(i));
}
data.add(item);
}
I've also tried forgoing the resultset and using a CachedRowSet, but that seems to take the same amount of time. I've also tried setting the fetch size in both cases, but the improvement was insignificant.
Any help is appreciated. Thanks.