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 Result Set size problem? 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 "Result Set size problem?" Watch "Result Set size problem?" New topic

Result Set size problem?

faisal ishaque

Joined: Feb 21, 2003
Posts: 14
I have a problem to get the exact size of result set. Let us assume that my query get 20 results and another query get 30 results, now how can i adjust the size of my collection (array) dynamically to adjust w.r.t result set size.
I use some technique that first get the count then perform another query for results , but this does not seems to be a good technique because there are some restriction of using ORACLE COUNT METHOD.
Can any one give me the best practices for setting collection(array) size w.r.t the result set size.
thanks and best regards.
Faisal Ishaque
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

Use a data structure that grows dynamically, like java.util.ArrayList.

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Result Set size problem?
It's not a secret anymore!