on 03-02-2007 7:42 AM
hi,
i am retreiving the data from sap fine....via jco
i want to retrieve the data every 1 hour , means every 1 hour it goes and
fetches the data , so, i want time interval ....
plz send me necessary code...........
thanks,
swathi
Hi Tony,
One possible way could be to create a thread that has a continuous loop with a sleep statement in it. I've used something similar for updating transaction data into SAP from a standalone appliction. You can then control this thread from your main thread and start it/stop it/set the refresh rate etc.
Gareth.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi tony,
you can try this:
TimerTask timerTask = new TimerTask()
{
public void run()
{
// Your code
}
};
Timer timer = new Timer();
timer.scheduleAtFixedRate(timerTask, 0, 1000);
check the documentation:
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Timer.html
http://java.sun.com/j2se/1.4.2/docs/api/java/util/TimerTask.html
Best,
Ignacio.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.