• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java code to run periodically to check the change in DB

 
Vibhas Kumar
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic