I have a ArrayList which I add a Array to. How will I access the array from the ArrayList?
Example :
/*Storing the array*/
String[] Container = new String[3];
ArrayList arr =new ArrayList();
ResultSet rec1 = st.executeQuery ("SELECT * FROM HistoryHeader WHERE DocumentDate BETWEEN '"+startDate +"' AND '"+endDate+"'") ;
while(rec1.next ()) {
Container[0] = rec1.getString( "DocumentType") ;
Container[1] = rec1.getString( "DocumentNumber ");
Container[2] = rec1.getString( "CustomerCode") ;
arr.add(Contain er);
}
/*Viewing the String Array from the Array list*/
I want to access the array like arr.get(1)[1]
So get element 1 from the stored array from the first ArrayList element.
Whats the syntax for this?
Example :
/*Storing the array*/
String[] Container = new String[3];
ArrayList arr =new ArrayList();
ResultSet rec1 = st.executeQuery ("SELECT * FROM HistoryHeader WHERE DocumentDate BETWEEN '"+startDate +"' AND '"+endDate+"'") ;
while(rec1.next ()) {
Container[0] = rec1.getString( "DocumentType") ;
Container[1] = rec1.getString( "DocumentNumber ");
Container[2] = rec1.getString( "CustomerCode") ;
arr.add(Contain er);
}
/*Viewing the String Array from the Array list*/
I want to access the array like arr.get(1)[1]
So get element 1 from the stored array from the first ArrayList element.
Whats the syntax for this?
Comment