In JavaWeb, does a scheduled task have to occupy a thread all the time?

if I want to scan the database at 1: 00 a. M. every day and do some statistics, does this scheduled task have to occupy a thread all the time?

Mar.09,2021

depending on your implementation, you can either open a single thread or schedule it through a common thread pool (so that threads are not monopolized). If you use Quartz, it already encapsulates the thread pool at the bottom.

Menu