Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populating Arraylist with db results?

Status
Not open for further replies.

barnarp

Programmer
May 7, 2002
16
ZA
hi,

I am trying to get the fastest method possible for inserting around 7000+ records
in an ArrayList.

Here are the options known to me:

1. Run an additional thread.
2. Open a small new browser window which handles the array in the 'background'.
3. Using a normal page calling a bean and displaying the arraylist results (too slow).

I would like to know which would be the most quick and efficient.



Regards

Pierre
 
Could you please provide more details about
your app ?

Is it a browser-based thing ?
Where do you get these 7000+ objects for the ArrayList
and how complex are they ?

Are they permanent for all users,
or the user somehow makes a selection ?

Etc.
 
Echoing HenryMonster there, this will need more information to fully answer.

A few things immediately come to mind, though.

1- is it necessary to put it in an ArrayList or can you use the resultset to do all the work? (a Vector will be necessary if you use a thread, but it is slightly slower)

2- how long is the query itself taking, and is there anyway to optimize that or take a smaller set at a time? For example, is there any logic you could put in the SQL itself (if you're not familiar with SQL, you may be surprised at the stuff you can do with it! show us the query if you do any logic with the ArrayList)
 
Thanks guys for your replies.

I sorted out the problem by using an arraylist.

Yeah your right, I should have given more details.

Sorry bout that.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top