Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I am geeting java.lang.ArrayIndexOutOfBoundsException: error for below code in tJavaFlex.my input row size is 2.
basically i wan to collect value of Key column from DB input into a array of string.Please suggest.
You can't change the size of an array after it has been created. You have created the array to have one element in your code in the "Start Code" section. If you know that there will be 2 rows coming into this JavaFlex, you will need to create your array as follows.....
String[] PrimaryKeyList = new String[2];
If you do not know the size of your array, you can use the java.util.ArrayList class. You can add to this without knowing the total number of elements. If you need an array out of this, you can convert it to an array by doing something like this....
ArrayList<String> PrimaryKeyList = new ArrayList<String>();
//Add to the array with any number of values
//To get the values converted to an array, do the following...
String[] array = PrimaryKeyList.toArray(new String[PrimaryKeyList.size()]);