Firing a Java event on a date / time based on a database row

I'm trying to make a Listener (or something like that?) That will fire a specific event when the date field from the database row is the same as the current time. Of course, I can run every second to check if the date / time matches the current, but I think it is quite expansive. There must be a better alternative.

I try to do the following: I have several (e.g. football) matches scheduled in my database. At a certain time, when the match starts, I started the event in my Java application. At this time, it may be 1 or more matches.

+4
source share
1 answer

, java-, .

ScheduledExecutorService schedule, .

, , - , .

EDIT: taskID- > ScheduledFuture, . - , , .

+5

All Articles