I have an ArrayList by columns, each column is a different query in my database, when showing column one "ITEMS" it shows perfect, but when showing column two "MATERIAL" it looks like the annoying null and below it shows the correct information, what happens? I have tried everything, but nothing works.
he tried with List.remove, List.RemoveIF, nothing works
private String[][] obtenerMatriz() {
DetalleEntradaControlador detalleEntradaCon = new DetalleEntradaControlador();
ArrayList<DetalleEntrada> lista = detalleEntradaCon.traerDesdeSAP();
String matrizInfo[][] = new String[lista.size()][8];
lista.removeAll(Collections.singleton(null));
for (int i = 0; i < lista.size(); i++) {
matrizInfo[i][0] = lista.get(i).getItem() + "";
matrizInfo[i][1] = lista.get(i).getMaterial() + "";
matrizInfo[i][2] = lista.get(i).getDescrip() + "";
matrizInfo[i][3] = lista.get(i).getEdadPersona() + "";
matrizInfo[i][4] = lista.get(i).getTelefonoPersona() + "";
}
return matrizInfo;
}
EDIT:
in my method, traerDesdeSAP, I have this Query and the .add to list....
public ArrayList<DetalleEntrada> traerDesdeSAP() {
ArrayList<DetalleEntrada> lista = new ArrayList<DetalleEntrada>();
DetalleEntrada detalle = null;
try {
Class.forName("com.sap.dbtech.jdbc.DriverSapDB");
Conn = java.sql.DriverManager.getConnection(sapsource.getSAPSOURCE());
s = Conn.createStatement();
//TRAER ITEMS POR NUMERO DE DOC
rs = s.executeQuery("...");
while (rs.next()) {
detalle = new DetalleEntrada();
detalle.setItem(rs.getString(1));
lista.add(detalle);
}
