I have a program here in the factory that, every 1 minute, an equipment connected to a supervisor sends a direct value into a table in the database (SQL Server).
I would like to know how to always get the last value and display it in a JTextField
, and every minute it tries to do this query.
In case, this code caters me perfectly, but my question now is how do I get the last value from the database that in this case would be (SQL Server).
int delay = 5000; // delay de 5 seg.
int interval = 5000; // intervalo de 1 seg.
Timer timer = new Timer();
timer.scheduleAtFixedRate(new TimerTask() {
public void run() {
jTextField6.setText("1");
}
}, delay, interval);
}