org.apache.cocoon.components.language.markup.xsp
Class PostgresOldEsqlQuery

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.language.markup.xsp.AbstractEsqlQuery
          extended by org.apache.cocoon.components.language.markup.xsp.PostgresOldEsqlQuery
All Implemented Interfaces:
LogEnabled

public final class PostgresOldEsqlQuery
extends AbstractEsqlQuery

Version:
CVS $Id: PostgresOldEsqlQuery.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Torsten Curdt

Constructor Summary
PostgresOldEsqlQuery(Connection connection, String query)
           
 
Method Summary
 String getQueryString()
          Return the query string ("select * from bla") NOTE: Might want to be overridden by indiviual EsqlQuery implementations e.g. for database specific LIMIT features.
 void getResultRows()
          Move to the first row.
 AbstractEsqlQuery newInstance(ResultSet resultSet)
          Create a EsqlQuery of the same type
 
Methods inherited from class org.apache.cocoon.components.language.markup.xsp.AbstractEsqlQuery
cleanUp, decGroupLevel, execute, execute, executeQuery, getCallableStatement, getConnection, getCurrentRow, getMaxRows, getMoreResults, getPreparedStatement, getQueryResultsCount, getResultSet, getResultSetMetaData, getRowCount, getSkipRows, getUpdateCount, getUpdateResultsCount, groupLevelExists, hasGroupingVarChanged, hasResultSet, incGroupLevel, keepGoing, nextRow, prepareCall, prepareStatement, setGroupingVar, setKeepGoing, setMaxRows, setPosition, setPreparedStatement, setSkipRows
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostgresOldEsqlQuery

public PostgresOldEsqlQuery(Connection connection,
                            String query)
Method Detail

newInstance

public AbstractEsqlQuery newInstance(ResultSet resultSet)
Create a EsqlQuery of the same type

Specified by:
newInstance in class AbstractEsqlQuery
Parameters:
resultSet -

getQueryString

public String getQueryString()
                      throws SQLException
Description copied from class: AbstractEsqlQuery
Return the query string ("select * from bla") NOTE: Might want to be overridden by indiviual EsqlQuery implementations e.g. for database specific LIMIT features. Be aware that there a two different limit approaches:
 retrieve                   query
 time                       time
 +---------+                ...........
 |JDBC     |                :         :
 |ResultSet|                :         :
 |.........|-+              :_________:_
 |         | | skip/max+1   |JDBC     | | skip/max+1
 |         | | window       |ResultSet| | window
 |.........| |              |_________| |
 |         |-+              :         :_|
 |         |                :         :
 +---------+                :.........:
  
With the "retrieve time" limit the JDBC ResultSet includes ALL of the rows of the query. With the "query time" limit only a small window of rows are in the actuall JDBC ResultSet. In order to know whether there are more rows available (without an additional query) we need to have at least one more row in the JDBC ResultSet. So we ask for getMaxRows()+1

Overrides:
getQueryString in class AbstractEsqlQuery
Throws:
SQLException

getResultRows

public void getResultRows()
                   throws SQLException
Description copied from class: AbstractEsqlQuery
Move to the first row. NOTE: Might want to be overridden by indiviual EsqlQuery implementations

Overrides:
getResultRows in class AbstractEsqlQuery
Throws:
SQLException


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.