title: Determine if an sql query modifies the database
body: <p>I have a list of strings that contain valid <code>SQL</code> expressions.<br>
  I need to execute only those that do not modify the database.<br>
  What would be the best way to do this? Just doing something like:  </p>
  
  <pre><code>if(sqlQuery.contains("DELETE")){  
    //don't execute this
  }
  </code></pre>
  
  <p>seems like a bad hack  </p>
  
  <p><strong>Update:</strong><br>
  I'll make this more specific.<br>
  I already have a list of <code>SQL</code> queries that are allowed. I want to make sure only these are executed.<br>
  What would be the best way to match against these?</p>