There are scheduling frameworks for tasks, however to just run a script daily you can use much simpler solutions. The operating systems have a task scheduler: in linux it has cron
, in windows it has Agendador de Tarefas
(name less creative, by the way).
Basically you create a java program that, when running, sends the emails with the queries, without worrying about the time. To schedule, you create a script like this:
@echo off
REM run the program
"C:\Program Files\Java\jdk1.7.0\bin\java.exe" -jar "C:\Users\User1 \Documents\project\emailConsulta.jar"
So just create a task in Windows Task Scheduler, accessed with Win + R > type "Taskschd.msc" > Enter. There you control which days of the week it will run, at what time, among other options.