title: When should we use a PreparedStatement instead of a Statement?
body: <p>I know the advantages of using <code>PreparedStatement</code>, which are</p>
  
  <ul>
  <li>query is rewritten and compiled by the database server</li>
  <li>protection against SQL injection</li>
  </ul>
  
  <p>But I want to know when we use it instead of <code>Statement</code>?</p>