In my application,I want load some data to the database at the midnight each day,how to set it using the Timer?
I have thought using:
Timer t=new Timer();
TimerTask tt=new TimerTask(){
public void run(
//read the data, and push to db
);
};
t.schedule(tt,(the next midnight-now time));
However, I am afraid this can only be executed once. Any fix?