Java Client - process() - not able parse through LinkedList

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
koti9
Participant
Posts: 52
Joined: Wed Nov 09, 2005 10:51 am

Java Client - process() - not able parse through LinkedList

Post by koti9 »

Hi all,

I am trying to use LinkedList for loop inside process() method. I was able to compile the java code fine and using a Java Client Stage to invoke the class file.

So when i use LinkedList for loop inside process() method, its keep repeating the first Record of the LinkedList for the rest of the loop instead of getting next record.

Inside process() method, here is my code i am trying to work it out...

Code: Select all

      for(int i=0; i<linkedlist.size(); i++)
      {
    	  Row outputRow = createOutputRow();
          outputRow.setValueAsSQLTyped(0,linkedlist.get(i));
          writeRow(outputRow);
      }
using if clause to exit when there are no rows..using return OUTPUT_STATUS_END_OF_DATA;

Did anyone tried this in 8.5? Please let me know, i just want to know how can we pass ArrayList/LinkedList or ResultSet to Process() Method and successfully parse it.

Thanks & Regards
Koti
koti9
Participant
Posts: 52
Joined: Wed Nov 09, 2005 10:51 am

Sorry all i was able find the issue

Post by koti9 »

Silly Me... I hardcoded i value inside get method for LinkedList.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So... for the Java Impaired in the audience, what should it have been? $i?
-craig

"You can never have too many knives" -- Logan Nine Fingers
koti9
Participant
Posts: 52
Joined: Wed Nov 09, 2005 10:51 am

'i' is RowNumber value

Post by koti9 »

'i' is RowNumber value Craig.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Know that... let me rephrase. Please post the corrected code for future generations. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply