I know how to manually set JTable column names, but wondering if there was better way because presently I have a prepared sql statement which selects from DB with column names made to show up as different name using the AS ‘New Column Name’, but the names in the AS part are not showing up, just the standard DB column names… Is that supposed to work that way or is there a better way apart from manually setting column header names using the getColumnModel().getColumn(2).setHeaderValue(“NEW NAME”) … ? Thanks
Share
The
ResultSetMetaDatamethodgetColumnLabel()should provide the text from a givenSELECT AS label. For example,