Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

issue in getting more than one data

 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to get all the campaignname whose campaignstatus is 1 using the following code.But I can able to get the last data only.



Please help me to solve this issue.

Thanks
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your getActiveCampaign() method, you have an instance of DialerDetails created once.
Each time the result set loop is traversed, the fields of this object are overwritten.

To achieve what you want, consider returning a collection of DialerDetails object and create one each time in the loop.
Something like



ram.

 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply.I have tried as you advised like the following:


But where do i print the value of campaignname and ratio to know whether i can able to get all the datas in the table?
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So now the call from your run() method receives a list of DialerDetails objects. Iterate through the list and for each object, call the dialNumber() method passing in the campaignName from the current object in your iteration.



ram.
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry.I dont understand where to insert this code.In dialNumber() or in run() method?
 
Ramasamy Anbalagan
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Preet,

You can check below code. could explain about dialNumber() method, where you have used primaryno variable, where its comming....




 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ramasamy, please use [code] tag to format your source. (Edit your message, and enclose your source with [code]...[/code])
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much. Now I can able to access all the datas.The primary number is also a data which i tried to retrieve.But i removed from the code earlier and forgot to remove when i post.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic