run a scheduled task once a day
<p>My requirement is I want to schedule a task that should run once a day.For that I am using following code:</p>

<pre><code>public class setAutoReminder {
    EscalationDAO escalationDAO=new EscalationDAO();
    final  SendMail sendMail=new SendMail();
    public void fetch(){
        Date date=new Date();
        Timer timer = new Timer();


        timer.schedule(new TimerTask(){
            public void run(){
                int number=escalationDAO.getAutoReminder();
                System.out.println(number);
                if(number&gt;0) {
                    sendMail.sendMail();
                }
            }
        },date, 1000000000);
    }
}
</code></pre>

<p>but this code runs multiple times.I want it to runs once a day.What should I do?</p>
