title: Monitoring changes in SQL db using Java
body: <p>I want to check for changes in a SQL database but not sure what the best approach would be. </p>
  
  <p>Currently what I do is I create an Object with column (key, value) information and store that into an ArrayList. I then copy that ArrayList and make a new one called my "cache". </p>
  
  <p>Now, this is what I'm doing: every X ms I am grabbing all the data from the SQL db and then comparing that to my cached local copy. If there is anything different e.g. a value has been updated, inserted or deleted, I have a listener to notify me.</p>
  
  <p>Is this a bad approach? Should I be doing a "SELECT * FROM table" query or is there another way I can get the information I want. I also want to be able to see the specific data that has been modified e.g. the row, the column and value.</p>
  
  <p>Note: The database is generic.</p>