Hello, I have the following problem I have an ArrayList that returns several small arrays of two positions
String[] temp = new String[2];
and has the arrayList that saves adds several "temp";
ArrayList lista = new ArrayList();
while(rs.next()){
if(rs.getString("texto") != null){
temp[0] = String.valueOf(rs.getInt("id"));
temp[1] = rs.getString("texto");
lista.add(temp);
}else{
temp[0] = String.valueOf(rs.getInt("id"));
temp[1] = rs.getString("valor");
}
}
Good temp[0]
contains the ID of a table my challenge and get the values from the ArrayList and group them by means of the ID position, so there would be only some arrays of type array tempx[]
contain all temp[1]
which has temp[0]
with the same value. Which then goes to another Array List
Type something like this
enquanto lista.get(a).temp[0] conter o mesmo identificador faça
tempx[i] = lista.get(i).temp[1]
i++;
Quando o lista.get(a).temp[0] mudar então um novo arrayList deve receber essa nova array.
listaAtualizada.add(tempx);
I'm not very good at ideas today and I'm suffering to do that.