Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

This resultset takes too long

843859May 12 2008 — edited May 14 2008
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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 11 2008
Added on May 12 2008
10 comments
416 views