I have 2 simple database query JTable
(Client and Server).
Client has all functions like view records, print, save PDF etc. Server auto refresh database records to table with a timer of 30secs. (Not yet implemented.)
My problem is I can display the database records to table with no issue with the following code.
PreparedStatement pst = conn.prepareStatement("SQL");
ResultSet rs = pst.ExecuteQuery();
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
But I wish to implement the auto refreshing of table with the above code with a timer.
Example, I inserted the codes into a methods called public void Update_Records()
. How am I supposed to use the timer to call the method to display the records into the table every 30 secs?