Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Result Set size problem?

 
faisal ishaque
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
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
Bartender
Posts: 9370
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a data structure that grows dynamically, like java.util.ArrayList.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!