This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Populating an ArrayList() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Populating an ArrayList()" Watch "Populating an ArrayList()" New topic
Author

Populating an ArrayList()

Rick Harrison
Greenhorn

Joined: Oct 16, 2000
Posts: 4
What is the best way to populate an ArrayList() from a sybase stored procedure result set? Thanks
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Create a class that has variables for each of the columns in your table. To be truly OO, you can make the variables private and add public get and set methods for each one. Instantiate one of these, add the columns to it, and add the object to your ArrayList. Instantiate a new one, add the columns, etc. until there are no more rows. Not recommended for ResultSets containing 25 million rows.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Populating an ArrayList()
 
It's not a secret anymore!