poornima visvesvaran wrote:
>
> I want a servlet to be executed automatically everyday
> (same time) to check in the database and send mails to
> some people.
>

 Servlets are request/response based, it doesn't really
make sense to execute them on their own. Nevertheless,
this is a frequently asked question, and there are
several good discussions in the archives.

 There's one thread you can find with the terms "execute
automatically", but if you search around a little, you'll
find more. The answers in the archives are (so far) a
little better than the ones in this thread, so I highly
recommend taking a look.

 Also: If you decide to go with a thread that sleeps
until a particular time, you don't have to poll, since
you can sleep(wakeup_time-current_time). You also
need to handle interruptions. If any of that isn't clear,
then I'd suggest taking a look at some of the utility
classes mentioned in the archive.

 Also: "Now tell me a solution" reads badly. You might
want to stick a "please" in there someplace :-)

-cks

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to