FileDocCategorySizeDatePackage
SimpleResultSetTable.javaAPI DocExample771Thu Apr 05 20:32:00 BST 2001None

SimpleResultSetTable

public class SimpleResultSetTable extends Table

Fields Summary
Constructors Summary
public SimpleResultSetTable(ResultSet rs)

    setBorder(1);

    ResultSetMetaData rsmd = rs.getMetaData();
    int colCount = rsmd.getColumnCount();

    TR row = new TR();
    for (int i = 1; i <= colCount; i++) {
      addElement(new TH().addElement(rsmd.getColumnName(i)));
    }
    addElement(row);

    while (rs.next()) {
      row = new TR();
      for (int i = 1; i <= colCount; i++) {
        addElement(new TD().addElement(rs.getString(i)));
      }
      addElement(row);
    }
  
Methods Summary