[Solved] insert data into database after an interval by Java [closed]

I would use the java.util.concurrent.* package since it’s newer and better for threading (which all timers/delay’s will need to implement in order to not block your program) This example will execute your task, then re-schedule itself automatically… nice! (the try/finally block ensures no exception will break our schedule): import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; class Task implements … Read more