title: Web pagination with JdbcTemplate and Oracle 11g / H2 without scrollable resultset
body: <p>This must have been done a thousand times but I can't find the Java code online. </p>
  
  <p>I'm coding a web page that shows a list from Oracle 11g, retrieved by a Dao using JdbcTemplate. </p>
  
  <p>It's essentially an audit log, with a search field for date to show log entries from that date and previous. </p>
  
  <p>My audit log service class will call the Dao and limit the number of rows returned to 100, and has to work out the latest date to specify on the query. Then it will pass back a list of audit log javabeans to the MVC layer. </p>
  
  <p>This is my best effort for the SQL, which has to be H2 (Oracle mode) compatible as well for testing purposes. (That rules out the row_number() function). latestDate and maxRows are the params.</p>
  
  <pre><code>    SELECT * FROM (
                  SELECT * FROM T_ETL_AUDIT_LOG 
                  WHERE LOG_TIMESTAMP  &lt; ?latestDate 
              ) WHERE rownum &lt; ?maxRows;
  </code></pre>
  
  <p>So I need to work out what the parameters on the web page are going to be (e.g. lastDate, previous, next), and the audit log service algorithm has to handle the first call (with date=Now), and previous page, next page without getting confused. </p>
  
  <p>I haven't searched for a pagination tag for the JSP yet so any suggestions would be cool but that's icing on the cake. </p>
  
  <p>NB I am not using Oracle 12 so I can't utilise the new Oracle pagination functionality</p>
  
  <p>2015-01-20 - just changed the title to exclude scrollable resultset solutions.</p>