This app must perform connection to a web service, grab data, save it in the database. Every hour 24/7. What's the most effective way to create such an app in java?
How should it be run - as a system application or as a web application?
This app must perform connection to a web service, grab data, save it in the database. Every hour 24/7. What's the most effective way to create such an app in java?
How should it be run - as a system application or as a web application?
look at quartz, its a scheduling library in java. they have sample code to get you started. you'd need that and the JDBC driver to your database of choice. no web container required - this can be easily done using a stand alone application
Why not use cron to start the Java application every hour? No need to soak up server resources keeping the Java application active if it's not doing anything the rest of the time, just start it when needed,
Keep it simple: use cron (or task scheduler)
If that's all what you want to do, namely to probe some web service once an hour, do it as a console app and run it with cron.
An app that starts and stops every hour
If you are intent on doing it in java a simple Timer would be more than sufficient.
Create a web page and schedule its execution with one of many online scheduling services. The majority of them are free, very simple to use and very reliable. Some allows you to create schedules of any complexity just like in cron, SqlServer job UI, etc. Saves you a LOT of headache creating/debugging/maintaining your own scheduling engine, even if it's based on some framework like Ncron, Quartz, etc. I'm speaking from my own experience.