0

I have a PostgreSQL database and a Java application which accesses this database using JDBC. Works just fine.

Now I have a table in the database, which is changed by some third party and I would like to get a notification from the database (over JDBC) to my Java application, if the data in this table is changed.

Currently I'm just checking the table in regular time intervals from my Java application (polling). But I think it's rather inelegant and generates some unnecessary traffic.

Is possible? And if yes, any pointers how I can achieve this?

3
  • 3
    The Listen/Notify mechanism combined with a trigger on the table could be something worth looking at. Commented Feb 7, 2020 at 11:07
  • thanks. i will look into this. sounds promising. Commented Mar 9, 2020 at 10:34
  • If polling works for you, it's still a lot easier. Think carefully how much you value perceived elegance over simplicity. Commented Mar 9, 2020 at 11:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.