File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Large ResultSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Large ResultSet" Watch "Large ResultSet" New topic

Large ResultSet

Pappu Kumar
Ranch Hand

Joined: Oct 01, 2002
Posts: 69
I have a query that returns anywhere from 1000 to 5000 rows. I have to show them to one screen (no paging). What are the ways in which i can get the best time performance. Let me know what i can do at Database, Server or whats the best Java technology that would gimme the best performance.
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

Save them in an ArrayList and display them in a JTable or such.
I'd hate to be the guy that has to read all 5000 rows!
Loren Rosen
Ranch Hand

Joined: Feb 12, 2003
Posts: 156
You may want to experiment with ResultSet.setFetchSize to see what value is the best.
I agree. Here's the link:
subject: Large ResultSet
It's not a secret anymore!