KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > daffodildb > server > sql99 > dql > listenerevents > _SelectIterator


1 package com.daffodilwoods.daffodildb.server.sql99.dql.listenerevents;
2
3 import com.daffodilwoods.daffodildb.client.*;
4 import com.daffodilwoods.daffodildb.server.datadictionarysystem.*;
5 import com.daffodilwoods.daffodildb.server.sql99.common.*;
6 import com.daffodilwoods.daffodildb.server.sql99.dql.resultsetmetadata.*;
7 import com.daffodilwoods.database.resource.*;
8 import com.daffodilwoods.daffodildb.client._BrowserPlan;
9
10 /**
11  * It provides full control of select query viz fetching of data, medium to
12  * understand the data returned, information about the selected columns of the
13  * query, modification through resultset.
14  * <p>Title: </p>
15  * <p>Description: </p>
16  * <p>Copyright: Copyright (c) 2003</p>
17  * <p>Company: </p>
18  * @author unascribed
19  * @version 1.0
20  */

21
22 public interface _SelectIterator extends _BrowserPlan{
23
24    /**
25     * It is used to get all the information about the columns present in
26     * select list of the query.
27     * @return ColumnCharacteristics
28     * @throws DException
29     */

30
31    _ColumnCharacteristics getColumnCharacteristics() throws DException;
32
33    /**
34     * It is used to read the row returned by select query. It is returned
35     * based on the type of ResultSet. It can be any of SCROLLABLE, NONSCROLLABLE
36     * and UPDTABLE.
37     * @return RowReader
38     * @throws DException
39     */

40
41    _RowReader getRowReader() throws DException;
42
43    /**
44     * This method moves the pointer to just before the first row. It is required
45     * before the start of fetching rows in forward direction.
46     * @throws DException
47     */

48
49    void beforeFirst() throws DException;
50
51    /**
52     * It is required to fetch the passed number of rows from the i + 1 position
53     * in forward direction, where i is the position where pointer was aligned
54     * previously. If pointer is aligned at BEFOREFIRST position then this method
55     * will return starting as many rows as equivalent to p ssed rowCount. If
56     * there are lesser number of rows present in resultset as compare to
57     * rowCount, then that many rows are returned.
58     * @param rowCount is maximum number of rows to be fetched.
59     * @return array of rows
60     * @throws DException
61     */

62
63    Object JavaDoc[] fetchForward(int rowCount) throws DException;
64
65    /**
66     * This method moves the pointer to just after the last row. It is required
67     * before the start of fetching rows in backward direction.
68     * @throws DException
69     */

70
71    void afterLast() throws DException;
72
73    /**
74     * It is required to fetch the passed number of rows from the i - 1 position
75     * in the backward direction, where i is the position where pointer was
76     * aligned previously. If pointer is aligned at AFTERLAST position then this
77     * method will return last as many rows as equivalent to passed rowCount. If
78     * there are lesser number of rows present in resultset as compare to
79     * rowCount, then that many rows are returned.
80     * @param rowCount is maximum number of rows to be fetched.
81     * @return array of rows
82     * @throws DException
83     */

84
85    Object JavaDoc[] fetchBackward(int rowCount) throws DException;
86
87    /**
88     * It allows user to move the pointer on the row denoting by the key passed.
89     * Each row is uniquely denoted by key.
90     * @param key
91     * @usage RecordSetBuffer
92     * @throws DException
93     */

94
95    void moveToRow(Object JavaDoc key) throws DException;
96
97    /**
98     * It allows the user to move the current pointer to i + rowCount when
99     * rowCount is positive or i - rowCount when rowCount is negative where i is
100     * the current pointer position. If there are lesser number of rows present
101     * in resultset as compare to rowCount, then that many rows are returned.
102     * @param rowCount
103     * @return
104     * @throws DException
105     */

106
107    int move(int rowCount) throws DException;
108
109    /**
110     * It is required to retrieve info related to data modifications through
111     * resultset.
112     * @return SelectColumnCharacteristics
113     * @throws DException
114     */

115
116    _SelectColumnCharacteristics getSelectColumnCharacteristics() throws DException;
117
118    /**
119     * It returns the number of rows present in the result set taken on select
120     * query.
121     * @return
122     * @throws DException
123     */

124
125    int getRowCount() throws DException;
126
127    /**
128     * This method inserts a row in the resultset with the passed value at the
129     * corresponding places indicated by column indexes. Insertion is supported
130     * on the resultset taken on single table select query.
131     * @param columnIndexes
132     * @param columnValues
133     * @return key of newly inserted row.
134     * @throws DException
135     */

136
137    Object JavaDoc insert(int[] columnIndexes,Object JavaDoc[] columnValues) throws DException; // will return rowReader.getKey()
138

139    /**
140     * This method updates a row denoted by the passed key. The row is updated
141     * for the columns indicated by the column indexes with the passed values.
142     * Updation is supported on the resultset taken on single table select query.
143     * @param key
144     * @param columnIndexes
145     * @param values
146     * @param row
147     * @return key of the updated row.
148     * @throws DException
149     */

150
151    Object JavaDoc update(Object JavaDoc key,int[] columnIndexes,Object JavaDoc[] values,Object JavaDoc row) throws DException ; // here key will be rowReader key and return object will also be rowReaderKey.
152

153    /**
154     * This method deletes a row denoted by the passed key. Deletion is supported
155     * on the resultset taken on single table select query.
156     * @param key denoting the row
157     * @throws DException
158     */

159
160    void delete(Object JavaDoc key) throws DException ; // key will be recordReaderKey
161

162    /**
163     * This method is required when user presses insert button on the GUI to
164     * insert a row. Then a blank row is inserted on the resultset taken on
165     * single table select query.
166     * @return key of newly inserted blank row
167     * @usage RecordSetBuffer
168     * @throws DException
169     */

170
171    Object JavaDoc moveToInsertRow() throws DException;
172
173    /**
174     * This method is required when user doesn't want to save the newly inserted
175     * blank row.
176     * @usage RecordSetBuffer
177     * @throws DException
178     */

179
180    void flushInsertedRecord() throws DException ;
181
182    /**
183     * This method is required to display the plan choosen for execution of the
184     * select query.
185     * @return QueryPlan
186     * @usage DaffodilDBBrowser
187     * @throws DException
188     */

189
190    _QueryPlan getQueryPlan() throws DException;
191
192    /**
193     * It is required to get the values of only selected columns when the result
194     * set is of UPDATABLE type. When resultset is updatable then whole row is
195     * returned so in that case, this method helps in retrieving values of
196     * selected columns.
197     * @return
198     * @throws DException
199     */

200
201    Object JavaDoc getSelectColumnValues() throws DException;
202
203    /**
204     * It is required to get the appropriate row based on the resultset type. If
205     * resultset is UPDATABLE then whole row is returned otherwise row consisting
206     * of the value of selected columns is returned.
207     * @return row
208     * @throws DException
209     */

210
211    Object JavaDoc getObject() throws DException;
212
213    /**
214     * It is required to know whether select query supports the updatable type of
215     * resultset. Select query of only single table without groupby, functional
216     * columns is candidate of updatable type.
217     * @return
218     * @usage ServerSession
219     * @throws DException
220     */

221
222    boolean isUpdatable() throws DException;
223
224    /**
225     * It is required to get the datatypes of selected columns present in select
226     * query
227     * @return data types of selected columns.
228     * @throws DException
229     */

230
231    int[] getDataTypes() throws DException;
232 }
233
Popular Tags