Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

too many records

 
nachagoni rishi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
What do i need to use if my database returns more number of rows.Can i still store in ArrayList
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm moving this to the JDBC forum.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The standard way to do this is to code a javaBean that contains the fields in each row. As you're retrieving rows in a while (resultSet.next()) {} loop, instantiate the javaBean for each row read, populate it with the data in that row, and then place the bean in an ArrayList using the add() method.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Merrill Higginson:
The standard way to do this is to code a javaBean that contains the fields in each row. As you're retrieving rows in a while (resultSet.next()) {} loop, instantiate the javaBean for each row read, populate it with the data in that row, and then place the bean in an ArrayList using the add() method.


Yes, an appropriate phrase would be "Collection of VOs".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic