Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

database polling using Java

Tags:

java

I am stuck at some point wherein I need to get database changes in a Java code. Request is to get any record updated, added, deleted in any table of db; should be recognized by Java program. How could it be implemented JMS? or a Java thread?

Update: Thanks guys for your support i am actually using Oracle as DB and Weblogic 10.3 workshop. Actually I want to get the updates from a table in which I have only read permission so guys what do you all suggest. I can't update the DB. Only thing I can do is just read the DB and if there is any change in the table I have to get the information/notification that certain data rows has been added/deleted or updated.

like image 239
user262577 Avatar asked Feb 27 '10 18:02

user262577


1 Answers

Unless the database can send a message to Java, you'll have to have a thread that polls.

A better, more efficient model would be one that fires events on changes. A database that has Java running inside (e.g., Oracle) could do it.

like image 105
duffymo Avatar answered Sep 19 '22 08:09

duffymo