Hey,
without Ajax and timers, it not seems to do this task.
I have also faced the same issue, where i need to push some data from server to client when it changes.
For this, you can user Server push AKA "Comet" programming.
In coment
- we make a channel between client and server, where client subscribes for particular channel.
- Server puts its data in the channel when it has it.
- when client reads the channel, it gets all the data in the channel and channel is emptied.
- so every time client reads from channel, it will get new data only.
Also to monitor DB changes, you can have two things,
- Some trigger/timer (Check out
Quartz Scheduler
)
- Event base mechanism, which pushes data in the channel on particular events.
basically, client can't know anything happening on server side, so you must push some data or event to tell client that, i have some new data, please call some method
. Its kind of notification. So please check in comet/server push with event notification.
hope this helps.
thanks.