• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to poll a database table for changes from a java program

 
thomas jacob
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to write a java program to poll a database table for changes. How do I get started? Please suggest

Thanks
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36027
432
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thomas,
There are two parts - the polling part and the JDBC part. For the polling part - what kind of application is it? If JEE, you can use the timer service. Otherwise, you can start a thread.
 
thomas jacob
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeanne,
Is there any similar examples available on the web. I really bothered about the transaction mangement and stuff.

 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36027
432
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Examples of what? You haven't said which approach you are looking at.

Also, what about transaction management? Polling is a read only activity. The other processes that are writing to the database would protect the data's ACID properties.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!