Meaningless Drivel is fun!*
The moose likes JSF and the fly likes Java code to run periodically to check the change in DB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "Java code to run periodically to check the change in DB" Watch "Java code to run periodically to check the change in DB" New topic
Author

Java code to run periodically to check the change in DB

Vibhas Kumar
Greenhorn

Joined: Oct 13, 2009
Posts: 28

Hi friends Its Vibhas and working on JSF although i am new to jfs but my problem some what related to java and database at the same time i dont know where exactly i post this question but still help me if any one knows it. I am currently working on Weblogic 9.2 server. My problem is i have a database table in which i have only read permission .
Now in my application i am connecting that database through jdbc connection (i.e in jsf itself). Now the problem is my application should run a continuous checking of that datatable to know that if any new entry is made in that table or not. That is i guess i have to write a script or something of that kind please help me . With some idea and if possible with some demo code to understand..
Thanks
Vibhas Kumar
Greenhorn

Joined: Oct 13, 2009
Posts: 28
One more thing i would like to add is in such change in database the user get a mail or notification that some change has taken place i.e one row added or updated in the database.
nitin pokhriyal
Ranch Hand

Joined: May 19, 2005
Posts: 263
vibhas,

If i understood your problem then you need to have some service which can be checking database periodically. If you are using spring then you can create some job "cron" which will do the task for you. You can get tutorials on that. but if you are not using spring then you need to have thread which will do the task for.

Let me know if i were able to answer your question.
Vibhas Kumar
Greenhorn

Joined: Oct 13, 2009
Posts: 28
Hi nitin you are absolutely correct there will a continuous polling say every day at least once. And if there is any change in database then i will get a notification that some change takes palce in database kind of thing. No i am not using Spring framework i am doing it on weblogic 9.2 jsf framework.
Kindly help me with some example if you can. Thanks
 
GeeCON Prague 2014
 
subject: Java code to run periodically to check the change in DB