aspose file tools*
The moose likes JDBC and the fly likes Populating an ArrayList() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
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()