Communication between Servlet and separate application?

Hello,

i am pretty new to servlets. what i am trying is to communicate between a servlet and a java application on one physical machine.

i have a servlet that receives data from users and puts it in a database. now i need a separate application that is constantly doing calculations based on the data in the database. i do not want to initiate the calculations via the servlets, but the application should somehow be notified by the servlet if some data has been put into the DB.

is there any way of doing this ?

thanks

[553 byte] By [ejones123a] at [2007-10-3 10:11:32]
# 1

The easiest way is probably have the servlet post the data to the DB, then post a timestamp to the DB for the time it finished putting data in.

The standalone application will regularly poll the timestamp field in the DB and compare it to the last time it retrieved data. If the timestamp is newer than the last retrieved data, then go to work pulling all the new data out and do the work. When done, store the timestamp as the time data was last retrieved.

stevejlukea at 2007-7-15 5:31:36 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...