1

I am creating a website (JSP based) that will show a graph based on data from a mysql table. The problem is, the data to be stored is based on a WSN (wireless sensor network), which is going to send the data once every hour. So i have to store the data every hour. How should I do this ? I need the data stored into the MySql table every hour automatically.

Thanks.

Showmik Bose
  • 109
  • 5
  • One suggestion is that you need to create rest service that is called with data periodically, from that you can store data in table. – Manish Prajapati Mar 31 '16 at 11:50
  • Better to user Spring Quartz framework and in terms of submit data use REST will give you move rich granularity to your application. – Vishal Gajera Mar 31 '16 at 11:59

1 Answers1

1

For Your functionality,

You should use TimerTask class(available in java.util package). TimerTask is a abstract class. use public void run() method to execute periodically.

You can check here.How to run a task periodically in Java

P S M
  • 1,121
  • 12
  • 29