FileDocCategorySizeDatePackage
QueryTag.javaAPI DocGlassfish v2 API4965Sat May 05 19:17:58 BST 2007org.apache.taglibs.standard.tag.el.sql

QueryTag

public class QueryTag extends org.apache.taglibs.standard.tag.common.sql.QueryTagSupport
Subclass for the JSTL library with EL support.
author
Hans Bergsten
author
Justyna Horwat

Fields Summary
private String
dataSourceEL
private String
sqlEL
private String
startRowEL
private String
maxRowsEL
Constructors Summary
public QueryTag()
Constructs a new QueryTag. As with TagSupport, subclasses should not provide other constructors and are expected to call the superclass constructor

        super();
    
Methods Summary
public intdoStartTag()

        evaluateExpressions();
	return super.doStartTag();
    
private voidevaluateExpressions()

        Integer tempInt = null;

        if (dataSourceEL != null) {
            rawDataSource = (Object) ExpressionEvaluatorManager.evaluate(
                "dataSource", dataSourceEL, Object.class, this, pageContext);
        }

        if (sqlEL != null) {
            sql = (String) ExpressionEvaluatorManager.evaluate("sql", sqlEL,
                String.class, this, pageContext);
        }

	if (startRowEL != null) {
	    tempInt = (Integer) ExpressionEvaluatorManager.evaluate(
                "startRow", startRowEL, Integer.class, this, pageContext);
	    if (tempInt != null)
		startRow = tempInt.intValue();
	}

	if (maxRowsEL != null) {
	    tempInt = (Integer) ExpressionEvaluatorManager.evaluate(
                "maxRows", maxRowsEL, Integer.class, this, pageContext);
	    if (tempInt != null)
		maxRows = tempInt.intValue();
	}
    
public voidsetDataSource(java.lang.String dataSourceEL)

	this.dataSourceEL = dataSourceEL;
	this.dataSourceSpecified = true;
    
public voidsetMaxRows(java.lang.String maxRowsEL)
Query result can be limited by specifying the maximum number of rows returned.

	this.maxRowsEL = maxRowsEL;
	this.maxRowsSpecified = true;
    
public voidsetSql(java.lang.String sqlEL)
Setter method for the SQL statement to use for the query. The statement may contain parameter markers (question marks, ?). If so, the parameter values must be set using nested value elements.

	this.sqlEL = sqlEL;
    
public voidsetStartRow(java.lang.String startRowEL)
The index of the first row returned can be specified using startRow.

	this.startRowEL = startRowEL;