File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes issue in getting more than one data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "issue in getting more than one data" Watch "issue in getting more than one data" New topic
Author

issue in getting more than one data

preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
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

Joined: Jan 24, 2005
Posts: 489

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

Joined: Oct 04, 2007
Posts: 518
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

Joined: Jan 24, 2005
Posts: 489

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

Joined: Oct 04, 2007
Posts: 518
Sorry.I dont understand where to insert this code.In dialNumber() or in run() method?
Ramasamy Anbalagan
Greenhorn

Joined: Dec 14, 2009
Posts: 20
Hi Preet,

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




Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Ramasamy, please use [code] tag to format your source. (Edit your message, and enclose your source with [code]...[/code])


[My Blog]
All roads lead to JavaRanch
preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
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.
 
 
subject: issue in getting more than one data