I'm developing a Java calendar, where I have the date and time saved in the database. However, what would be the best way to display an alert 5 minutes before the event? Do I have to run the query method all the time until the hours hit? Or is there a simpler way to do this?