title: Getting events from a database
body: <p>I am not very familiar with databases and what they offer outside of the CRUD operations.</p>
  <p>My research has led me to <strong>triggers</strong>. Basically it looks like triggers offer this type of functionality:</p>
  <blockquote>
  <p>(from <a href="http://en.wikipedia.org/wiki/Database_trigger" rel="noreferrer">Wikipedia</a>)</p>
  <p>There are typically three triggering events that cause triggers to &quot;fire&quot;:</p>
  <ul>
  <li>INSERT event (as a new record is being inserted into the database).</li>
  <li>UPDATE event (as a record is being changed).</li>
  <li>DELETE event (as a record is being deleted).</li>
  </ul>
  </blockquote>
  <p>My question is: is there some way I can be notified in Java (preferably including the data that changed) by the database when a record is Updated/Deleted/Inserted using some sort of trigger semantics?</p>
  <p>What might be some alternate solutions to this problem? How can I listen to database events?</p>
  <p><strong>The main reason I want to do this is a scenario like this</strong>:</p>
  <p>I have 5 client applications all in different processes/existing across different PCs.  They all share a common database (Postgres in this case).</p>
  <p>Lets say one client changes a record in the DB that all 5 of the clients are &quot;interested&quot; in. I am trying to think of ways for the clients to be &quot;notified&quot; of the change (preferably with the affected data attached) instead of them querying for the data at some interval.</p>