[Solved] Data retrieving from a database to a table by clicking a button [duplicate]


it also should display in the jTable without clearing existing data (as a new row)

Well then you can’t use the setModel(...) method since that will replace all the existing data with the new data.

And you can’t use the DbUtils.resultSetToTableModel(...) method since that will return new TableModel.

Instead you will need to read the data from the ResultSet one row at a time. As you read each row you will then you can use the addRow(...) method of the DefaultTableModel to add each new row of data to the existing model.

3

solved Data retrieving from a database to a table by clicking a button [duplicate]