org.apache.commons.jelly.tags.sql
Class QueryTag

java.lang.Object
  extended byorg.apache.commons.jelly.TagSupport
      extended byorg.apache.commons.jelly.tags.sql.SqlTagSupport
          extended byorg.apache.commons.jelly.tags.sql.QueryTag
All Implemented Interfaces:
javax.servlet.jsp.jstl.sql.SQLExecutionTag, org.apache.commons.jelly.Tag

public class QueryTag
extends SqlTagSupport

Tag handler for <Query> in JSTL.

Author:
Hans Bergsten, Justyna Horwat

Field Summary
protected  int maxRows
           
protected  boolean maxRowsSpecified
           
protected  int startRow
           
 
Fields inherited from class org.apache.commons.jelly.tags.sql.SqlTagSupport
dataSourceSpecified, isPartOfTransaction, rawDataSource, scope, sql, var
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
QueryTag()
           
 
Method Summary
 void doTag(org.apache.commons.jelly.XMLOutput output)
          Execute the SQL statement, set either through the sql attribute or as the body, and save the result as a variable named by the var attribute in the scope specified by the scope attribute, as an object that implements the Result interface.
 void setMaxRows(int maxRows)
          Query result can be limited by specifying the maximum number of rows returned.
 void setStartRow(int startRow)
          The index of the first row returned can be specified using startRow.
 
Methods inherited from class org.apache.commons.jelly.tags.sql.SqlTagSupport
addSQLParameter, clearParameters, getConnection, hasParameters, setDataSource, setParameters, setScope, setSql, setVar
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxRows

protected int maxRows

maxRowsSpecified

protected boolean maxRowsSpecified

startRow

protected int startRow
Constructor Detail

QueryTag

public QueryTag()
Method Detail

setStartRow

public void setStartRow(int startRow)
The index of the first row returned can be specified using startRow.


setMaxRows

public void setMaxRows(int maxRows)
Query result can be limited by specifying the maximum number of rows returned.


doTag

public void doTag(org.apache.commons.jelly.XMLOutput output)
           throws org.apache.commons.jelly.JellyTagException

Execute the SQL statement, set either through the sql attribute or as the body, and save the result as a variable named by the var attribute in the scope specified by the scope attribute, as an object that implements the Result interface.

The connection used to execute the statement comes either from the DataSource specified by the dataSource attribute, provided by a parent action element, or is retrieved from a JSP scope attribute named javax.servlet.jstl.sql.dataSource.

Throws:
org.apache.commons.jelly.JellyTagException


Copyright © 2002-2006 Apache Software Foundation. All Rights Reserved.