• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Is servlet appropriate for reading a schedule file from a file system?

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I was given a pretty routine task to read a xml file from a file system and update its content into the database.
I already had a jaxb program to read the object from xml file and update it to database. Since the xml file is put there on my machine at 8am each day, and I have to write
a schedule program to pick up the file. I have not work on schedule program before so I would like to seek your help. I am thinking about reusing my jaxb program. I wonder what is the best way to approach it? Could i write a scheduler program in eclipse , and how do I call that program at a certain time, let says 7:58 am in the morning?

Thanks again for all of your help,

Mike
 
Sheriff
Posts: 24654
58
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A servlet? To run a scheduled job at the same time every day? No.

Just set up a cron job or a Windows scheduler job, depending on what operating system your file resides on.
 
Marshal
Posts: 67299
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It does not sound like a servlet is an appropriate technology for this. Servlets are used to respond to requests from a browser.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quartz Job Scheduler
-just google and see whether it can help you.
 
Greenhorn
Posts: 5
Netbeans IDE C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was faced with the same issue that you're facing a while ago. There are really no allowable ways of scheduling a process using a servlet since you should not be creating threads on your own. Therefore, it's advisable to use a cron job or a Window's service. Since I was using Windows, I elected to employ a java based Window's service. What a mistake as it was extremely fidgety to say the least. Fortunately, I know C# rather well having taught it many times over the years so I created my Window's service using that language.
 
Would you like to try a free sample? Today we are featuring tiny ads:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!