Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying rows

 
Sunny Singh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have collection of rows, But when displaying all i get is last row multiple times. I am using MySQL.

Thanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35266
383
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sunny,
Welcome to JavaRanch!

Can you post the query and a code snippet? This will help us answer your question. And note there are UBB code tags below the edit window for formatting code.
 
Kareem Qureshi
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sunny,

This problem can happen when you are using a collections object to collect the result set and populating the collection object using the same reference of the object(Results Object).
What happens is that you will same number of rows as they are database but the since the object reference is same all the rows will have same values.
To correct this problem you would need to create a new reference of the result object each time you iterate through the result set.

Hope this helps.

Thanks
Kareem
 
Anand Karia
Ranch Hand
Posts: 156
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Sunny Singh!!

It would be more feasible for you and us to help you out, if you submit your code.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic