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

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.JdbcEsqlQuery
All Implemented Interfaces:
LogEnabled

public final class JdbcEsqlQuery
extends AbstractEsqlQuery

This EsqlQuery only uses the standard JDBC API approaches. Please note that whether this is good, ok or bad depends on the driver implementation of your database vendor. It should work with all JDBC compliant databases. Unfortunately it seems NOT to work with mssql

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

Constructor Summary
JdbcEsqlQuery(Connection connection, String query)
           
 
Method Summary
 void getResultRows()
          Move to the first row.
 int getRowCount()
          AFAIK this is the proposed JDBC API way to get the number of results.
 AbstractEsqlQuery newInstance(ResultSet resultSet)
          Create a EsqlQuery of the same type
 CallableStatement prepareCall()
          NOTE: Might want to be overridden by indiviual EsqlQuery implementations
 PreparedStatement prepareStatement()
          NOTE: Might want to be overridden by indiviual EsqlQuery implementations
 
Methods inherited from class org.apache.cocoon.components.language.markup.xsp.AbstractEsqlQuery
cleanUp, decGroupLevel, execute, execute, executeQuery, getCallableStatement, getConnection, getCurrentRow, getMaxRows, getMoreResults, getPreparedStatement, getQueryResultsCount, getQueryString, getResultSet, getResultSetMetaData, getSkipRows, getUpdateCount, getUpdateResultsCount, groupLevelExists, hasGroupingVarChanged, hasResultSet, incGroupLevel, keepGoing, nextRow, 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

JdbcEsqlQuery

public JdbcEsqlQuery(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 -

prepareStatement

public PreparedStatement prepareStatement()
                                   throws SQLException
Description copied from class: AbstractEsqlQuery
NOTE: Might want to be overridden by indiviual EsqlQuery implementations

Overrides:
prepareStatement in class AbstractEsqlQuery
Throws:
SQLException

prepareCall

public CallableStatement prepareCall()
                              throws SQLException
Description copied from class: AbstractEsqlQuery
NOTE: Might want to be overridden by indiviual EsqlQuery implementations

Overrides:
prepareCall in class AbstractEsqlQuery
Throws:
SQLException

getRowCount

public int getRowCount()
                throws SQLException
AFAIK this is the proposed JDBC API way to get the number of results. Unfortunately -at least some- driver implementation are transfering the complete resultset when moving to the end. Which is totally stupid for limit/paging purposes. So we probably better stick with an additional count query from the AbstractEsqlQuery

Overrides:
getRowCount in class AbstractEsqlQuery
Returns:
total number of rows
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.