I am using Informix DB. This question may not be tied to one specific database. But I want to know how I can in
JAVA, continuously probe into a Database and check if a certain row has been added to a table in the DB. Basically, the flow is:
(1) My JAVA application should use
JDBC to check if a certain table is populated.
(2) If no, it should wait until a row has been inserted.
My question how can I have JAVA be aware of a row insertion. I am not expecting to add any triggers or anything, but in pure java be able to check that the row is added.
Some thoughts that come to my mind are continuously call DB for the row, or periodically (every half-hour or so) call DB and check if the row is available. But what I am looking for is something like a Listener which can do this.
Regards
Mahesh