|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.cocoon.components.language.markup.xsp.AbstractEsqlQuery
public abstract class AbstractEsqlQuery
This is base class for all EsqlQueries
Constructor Summary | |
---|---|
protected |
AbstractEsqlQuery(Connection connection,
String query)
Constructor |
protected |
AbstractEsqlQuery(ResultSet resultSet)
Only newInstance may use this contructor |
Method Summary | |
---|---|
void |
cleanUp()
Clean up all database resources used by the query. |
void |
decGroupLevel()
|
boolean |
execute()
|
boolean |
execute(int resultSetFromObject)
|
boolean |
executeQuery()
|
CallableStatement |
getCallableStatement()
|
Connection |
getConnection()
|
int |
getCurrentRow()
|
int |
getMaxRows()
|
boolean |
getMoreResults()
Try to get the next ResultSet |
PreparedStatement |
getPreparedStatement()
|
int |
getQueryResultsCount()
Returns the number of query results |
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. |
ResultSet |
getResultSet()
|
ResultSetMetaData |
getResultSetMetaData()
|
int |
getRowCount()
Gets the total number of rows of a the query WITHOUT the limits of skip/max rows. |
int |
getSkipRows()
|
int |
getUpdateCount()
Returns the how many rows where updated on last update |
int |
getUpdateResultsCount()
Returns the number of update results |
boolean |
groupLevelExists()
|
boolean |
hasGroupingVarChanged()
|
boolean |
hasResultSet()
|
void |
incGroupLevel()
|
boolean |
keepGoing()
|
abstract AbstractEsqlQuery |
newInstance(ResultSet resultSet)
Create a EsqlQuery of the same type |
boolean |
nextRow()
|
CallableStatement |
prepareCall()
NOTE: Might want to be overridden by indiviual EsqlQuery implementations |
PreparedStatement |
prepareStatement()
NOTE: Might want to be overridden by indiviual EsqlQuery implementations |
void |
setGroupingVar(String key)
|
void |
setKeepGoing(boolean still)
|
void |
setMaxRows(int i)
|
protected void |
setPosition(int p)
|
protected PreparedStatement |
setPreparedStatement(PreparedStatement ps)
|
void |
setSkipRows(int i)
|
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 |
---|
protected AbstractEsqlQuery(Connection connection, String query)
connection
- query
- - The SQL query stringprotected AbstractEsqlQuery(ResultSet resultSet)
resultSet
- Method Detail |
---|
public abstract AbstractEsqlQuery newInstance(ResultSet resultSet)
resultSet
- public String getQueryString() throws SQLException
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
SQLException
public PreparedStatement prepareStatement() throws SQLException
SQLException
public CallableStatement prepareCall() throws SQLException
SQLException
public int getRowCount() throws SQLException
SQLException
public void getResultRows() throws SQLException
SQLException
public void cleanUp()
protected final void setPosition(int p)
protected final PreparedStatement setPreparedStatement(PreparedStatement ps)
public final Connection getConnection()
public final int getSkipRows()
public final void setSkipRows(int i)
public final int getMaxRows()
public final void setMaxRows(int i)
public final ResultSetMetaData getResultSetMetaData()
public final PreparedStatement getPreparedStatement()
public final CallableStatement getCallableStatement()
public final ResultSet getResultSet()
public final boolean nextRow() throws SQLException
SQLException
public final int getCurrentRow()
public final boolean execute(int resultSetFromObject) throws SQLException
SQLException
public final boolean execute() throws SQLException
SQLException
public final boolean executeQuery() throws SQLException
SQLException
public final boolean getMoreResults() throws SQLException
SQLException
public final boolean hasResultSet()
public final int getUpdateCount()
public final int getQueryResultsCount()
public final int getUpdateResultsCount()
public final boolean keepGoing()
public final void setKeepGoing(boolean still)
public final void incGroupLevel()
public final void decGroupLevel()
public final boolean groupLevelExists()
public final void setGroupingVar(String key) throws SQLException
SQLException
public final boolean hasGroupingVarChanged() throws SQLException
SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |