On windows the best way to do it is to create a batch file that runs the
class with code similar to the way you would run any java (FYI - I doesn't
have to have anything to do with Servlets for DB connections. That is part
of the core Java API).
By using a batch file you wont need to have the VM running all the time.
if(exceptions && !your production VM)
Log them and call System.exit(1).
else
call System.exit(0)
<the-code>
cd <% drive-letter %>:\<% directory where you class is %>
java <% class name %>
</the-code>
<alternative-code>
java <% drive-letter %>:\<% directory where you class is %>\<% class name %>
</alternative-code>
Then create the scheuled task with the wizard:
Settings --> Control Panel --> Scheduled Tasks
Select the batch file you want to schedule and the time to run it.
May need a few tweaks.
Good luck,
Burkeman
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
poornima visvesvaran
Sent: Friday, February 23, 2001 4:34 AM
To: [EMAIL PROTECTED]
Subject: Re: Automatic Servlet Execution?
We are using Windows.
--- Kyle Burke <[EMAIL PROTECTED]> wrote:
> Are you using Windows or Unix?
>
> -----Original Message-----
> From: A mailing list for discussion about Sun
> Microsystem's Java Servlet
> API Technology.
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> poornima visvesvaran
> Sent: Friday, February 23, 2001 2:47 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Automatic Servlet Execution?
>
>
> Hi aravind,
>
> I am not stick with servlets. But I want some java
> technology idea to do that task.
>
> Can you give me some idea , if possible, program
> code
> to do automatic execution.
>
> Poornima Visvesvaran.
>
> --- Aravind <[EMAIL PROTECTED]> wrote:
> > hi,
> >
> > u can schedule a java program to send mail just u
> > have to add the job to
> > crontab (in unix) or using at (in NT).
> > i couldnt understand why u r particular on using
> > servlet for this purpose.
> >
> > i have made a same thing like this, in which my
> java
> > program checks for
> > connectvity and send the status as mail for every
> > hour. for this i have used
> > cron in unix environment. (the cron will
> > automatically send the program
> > output as mail, for more info refer cron
> > documentation)
> >
> > Aravind
> >
> > ----- Original Message -----
> > From: poornima visvesvaran
> <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, February 23, 2001 12:54 PM
> > Subject: Automatic Servlet Execution?
> >
> >
> > Hi Friends,
> >
> > I want a servlet to be executed automatically
> > everyday
> > (same time) to check in the database and send
> mails
> > to
> > some people.
> >
> > Is it possible to run the servlet like mentioned
> > above? If yes, How?
> >
> > Can you please send with details immediately.
> >
> > Thanks in advance.
> >
> > Poornima Visvesvaran.
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Auctions - Buy the things you want at great
> > prices!
> > http://auctions.yahoo.com/
> >
> >
>
___________________________________________________________________________
> > 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
> >
> >
>
___________________________________________________________________________
> > 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
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great
> prices!
> http://auctions.yahoo.com/
>
>
___________________________________________________________________________
> 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
>
>
___________________________________________________________________________
> 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
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices!
http://auctions.yahoo.com/
___________________________________________________________________________
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
___________________________________________________________________________
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