Link to home
Start Free TrialLog in
Avatar of bhession
bhession

asked on

An alternative to the Vector container

Ok I have been using Vector arrays for storing data objects. Inserting them and recalling them from a database for example. I believe vectors have a limit of something like 900 entries allowed in them. A problem I forsee in the future. So to this end I need an alternative container. Any suggestions?
Avatar of colr__
colr__

Take a look at ArrayList
ASKER CERTIFIED SOLUTION
Avatar of enachemc
enachemc
Flag of Afghanistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yeh, I'd never heard about the max size issue either tbh. ArrayList was just an alternative to Vector. There is a whole bunch of classes in the collections package that might be of use to you. You might also want to consider a custom data structure, depending on your usage.
Avatar of bhession

ASKER

Ok can you point me to a good place to learn how to use this array list. Also as I am pulling from a very large database maybe 100,000 rows should I be concerned by using an ArrayList?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
... plus pulling 100,000 from your database is going to grind it to a halt, nevermind your application logic.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry enachemc, could you expand on the below so I could better understand what you mean.

"no_of_items should exceed the required capacity (otherwise, ArrayList will expand its size, but at a cost of slowing you down a tiny bit)"

I'm unsure as to what your saying. Thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
that is true
so ensure a correct estimate
an incorrect estimate would still work, but 0.1% slower
SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks guys.