Hi,
Use the java.swing.Timer class, set the delay interval to 5mins and start this
timer in init() method of your servlet. Or You can use the "thread", but the
previous method is simple to implement which internally calling Thread.

example code.
--------------

public TestServlet extends HttpServlet{

public void init(){
// Your actual code..
DisplayResults disRes = new DisplayResults();

  Timer startTimerThread = new Timer( 5 * 60 * 1000, disRes);
  startTimerThread.setDelay(5 * 60 * 1000);
  startTimerThread.setRepeats(true);
  startTimerThread.start();
}// end of init method

}// end of servlet

// Inner class "DisplayResults" starts here..

class DisplayResults{

public DisplayResults(){
}

 public void actionPerformed(java.awt.event.ActionEvent event)
 {
    // call your query and display the results here
 }
}// end of DisplayResults

Note: For more info read "Timer" class documentation.

Cheerz
G S Sundaram

Rajeshwar Rao Vadheraju wrote:

> Hi friends,
>
> How can I write a servlet which gets some results from Database for every 5
> mins and diplays them on Browser?
>
> If give me some code ,I am very much thankful to you.
>
> Rajeshwar Rao
>
> ___________________________________________________________________________
> 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

Reply via email to