ruquia tabassum wrote:Timer and Timer Task are the good choice or do i need to opt Quartz?..
my main requirement is just to update a table at given instance of time and connecting to database and updations are all possible in servlets then why servlet is not a good choice?
K Tewari wrote:I don't think it is possible to execute a job at specific time(every day at 7:00 AM in your case) using java timer class.
Bauke Scholtz wrote:You're wrong.
Did you read the API docs of Timer and TimerTask?
Paul Sturrock wrote:
schedule(TimerTask task, Date time) is how you do it.
SCJP [1.4]
ruquia tabassum wrote:My requirement is user provides the date and time, and based on that date and time provided the servlet should execute and make updates in the database.. how do i trigger a servlet from timer
A Servlet is a poor choice for this logic. Servlets exist to service requests, so to get the functionality you want you would need to wtire something that sends the request at your set time. Rather than doing this you could just use a Timer and TimerTask to do the same.
Rahul Juneja
ThoughtClicks - http://techlabs.thoughtclicks.com
Don't get me started about those stupid light bulbs. |