Dunque!
Ho una sevler che si occupa di recuperare i valori da un database sfruttando le librerie ECS. Il valori vengono poi visualizzati in una jsp, ma questo non è un problema.
Il fatto è che vorrei mettere un carattere (per esempio "-" )al posto dei campi null. Ho provato a fare così:
public class table extends Table {
public table(ResultSet rs) throws SQLException {
setBorder(1);
setCellPadding(2);
setCellSpacing(0);
ResultSetMetaData rsmd = rs.getMetaData();
int nCol = rsmd.getColumnCount();
TR row = new TR();
for (int i=1; i<=nCol;i++) {
addElement(new TH().addElement(rsmd.getColumnName(i)));
}
addElement(row);
while (rs.next()) {
row = new TR();
for (int i=1; i<=nCol;i++) {
if (rs.getString(i) != "") {
addElement(new TD().addElement(rs.getString(i)));
} else {
addElement(new TD().addElement("-"));
}
}
addElement(row);
}
}
}
Il problema è che non inserisce il carattere voluto nei campi vuoti.
Secondo voi nel ciclo if in questione (quello in bold) cosa devo inserire?