📅  最后修改于: 2022-03-11 14:52:12.697000             🧑  作者: Mango
public static DefaultTableModel buildTableModel(ResultSet rs)
throws SQLException {
ResultSetMetaData metaData = rs.getMetaData();
// names of columns
Vector columnNames = new Vector();
int columnCount = metaData.getColumnCount();
for (int column = 1; column <= columnCount; column++) {
columnNames.add(metaData.getColumnName(column));
}
// data of the table
Vector> data = new Vector>();
while (rs.next()) {
Vector