I'm trying to display more detailed column headers, without using the database column names supplied by DbUtils.resultSetToTableModel()
. Here is my code:
ResultSet rs = null;
PreparedStatement pst = null;
String sql = "SELECT * From product";
String col[] = {"Product No", "Name", "Price", "QOH"};
DefaultTableModel dtm = new DefaultTableModel();
try {
pst = conn.prepareStatement(sql);
rs = pst.executeQuery();
dtm.setColumnIdentifiers(col);
ProductList_tbl.setModel(dtm);
ProductList_tbl.setModel(DbUtils.resultSetToTableModel(rs));
}
but it still displays the database table column names.