KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > taglibs > standard > tag > rt > sql > QueryTag


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.taglibs.standard.tag.rt.sql;
17
18 import org.apache.taglibs.standard.tag.common.sql.QueryTagSupport;
19
20 /**
21  * Subclass for the JSTL library with rtexprvalue support.
22  *
23  * @author Hans Bergsten
24  * @author Justyna Horwat
25  */

26 public class QueryTag extends QueryTagSupport {
27
28     //*********************************************************************
29
// Constructor
30

31     /**
32      * Constructs a new QueryTag. As with TagSupport, subclasses
33      * should not provide other constructors and are expected to call
34      * the superclass constructor
35      */

36     public QueryTag() {
37         super();
38     }
39
40     //*********************************************************************
41
// Accessor methods
42

43     public void setDataSource(Object JavaDoc dataSource) {
44     this.rawDataSource = dataSource;
45     this.dataSourceSpecified = true;
46     }
47
48     /**
49      * The index of the first row returned can be
50      * specified using startRow.
51      */

52     public void setStartRow(int startRow) {
53         this.startRow = startRow;
54     }
55
56     /**
57      * Query result can be limited by specifying
58      * the maximum number of rows returned.
59      */

60     public void setMaxRows(int maxRows) {
61         this.maxRows = maxRows;
62     this.maxRowsSpecified = true;
63     }
64
65     /**
66      * Setter method for the SQL statement to use for the
67      * query. The statement may contain parameter markers
68      * (question marks, ?). If so, the parameter values must
69      * be set using nested value elements.
70      */

71     public void setSql(String JavaDoc sql) {
72     this.sql = sql;
73     }
74
75 }
76
Popular Tags