I initialized the array to check if the program is running fine.
But now I want the array "long[][] input" to be initialized by taking the whole table from the database. How can I do this??
Something like this... (not tested but hopefully it either works or inspires you) But I think you can't guarantee that the columns will be read in the order you want... not sure... maybe you should do additional processing to see what is the number associated to the name of the column... but you can based your work on this
List<Tuple> precedences = selectFrom(precedence).list();
long[][] input new long[a][b];//calculate a and b yourself:)
int row=0;
int col=0;
for (Tuple t : precedences) {
col=0;
precedence.getColumns().forEach(col->{
String colName = col.getMetadata().getName();
if (!colName.equals("al_id")) {
input[row][col]=(long)t.get(col);
col++;
}
});
row++;
}