tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre D Bonner <...@bonnerinc.com>
Subject Re: Running a class on startup - java newbie....
Date Tue, 01 Jul 2003 21:55:01 GMT
>What I'd like to do is
> have <something> running that sleeps for 5 minutes at a time and then checks
> to see if 24 hours have passed since the row was inserted (and if so, delete
> it).  Is there a way to start up a class with my web app?
> 


Looks like good old Thread based timer

It is a thread that sits and calls a method every 5 minutes?

while(true){
Thread.sleep(5 * 60 * 1000) // 5 minutes exactly

  // lookup my jdbc Datasource
 // do my jdbc checking?
  // releaseConnection
  // loop
}


-- 
Andre D Bonner
Sun Certified Programmer for the Java 2 Platform 1.4



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message