title: SQL LIMIT vs. JDBC Statement setMaxRows. Which one is better?
body: <p>I want to select the Top 10 records for a given query. So, I can use one of the following options:</p>
  
  <ul>
  <li>Using the JDBC <a href="https://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html#setMaxRows(int)" rel="noreferrer"><code>Statement.setMaxRows()</code></a> method</li>
  <li>Using LIMIT and OFFSET in the SQL query</li>
  </ul>
  
  <p>What are the advantages and disadvantages of these two options?</p>