rowList.add(sc.getPosition() - 1, (String)output);
} else {
throw new Exception("Unknown groovy script return type (neither a Map nor a String).");
}
}
tempRows.add(new DefaultTableRow(rowList.toArray()));
}
rs.close();
// loop on script columns
for (ListIterator sIt = scripts.listIterator(); sIt.hasNext();) {
final ScriptColumn sc = (ScriptColumn)sIt.next();
columnTitlesList.add(sc.getPosition() - 1, sc.getTitle());
}
columnTitles = (String[])columnTitlesList.toArray(new String[0]);
rows = (TableRow[]) tempRows.toArray(new TableRow[0]);
} catch (Exception e) {
e.printStackTrace();
logger.error("?", e);
// problem occured, set table model to zero size
rows = new TableRow[1];
columnTitles = new String[1];
columnTitles[0] = "An error occured";
Object[] row = new Object[1];
row[0] = e.toString();
rows[0] = new DefaultTableRow(row);
ready=false;
return;
} finally {
try {
con.close();