KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > sql > execute > NoPutResultSet


1 /*
2
3    Derby - Class org.apache.derby.iapi.sql.execute.NoPutResultSet
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.iapi.sql.execute;
23
24 import org.apache.derby.iapi.sql.ResultSet;
25 import org.apache.derby.iapi.error.StandardException;
26
27 import org.apache.derby.iapi.types.RowLocation;
28 import org.apache.derby.iapi.store.access.RowLocationRetRowSource;
29
30 /**
31  * The NoPutResultSet interface is used to provide additional
32  * operations on result sets that can be used in returning rows
33  * up a ResultSet tree.
34  * <p>
35  * Since the ResulSet operations must also be supported by
36  * NoPutResultSets, we extend that interface here as well.
37  *
38  * @author jerry
39  */

40 public interface NoPutResultSet extends ResultSet, RowLocationRetRowSource
41 {
42     // method names for use with SQLState.LANG_RESULT_SET_NOT_OPEN exception
43

44     public static final String JavaDoc ABSOLUTE = "absolute";
45     public static final String JavaDoc RELATIVE = "relative";
46     public static final String JavaDoc FIRST = "first";
47     public static final String JavaDoc NEXT = "next";
48     public static final String JavaDoc LAST = "last";
49     public static final String JavaDoc PREVIOUS = "previous";
50
51     /**
52      * Mark the ResultSet as the topmost one in the ResultSet tree.
53      * Useful for closing down the ResultSet on an error.
54      */

55     public void markAsTopResultSet();
56
57     /**
58      * open a scan on the table. scan parameters are evaluated
59      * at each open, so there is probably some way of altering
60      * their values...
61      * <p>
62      * openCore() can only be called on a closed result
63      * set. see reopenCore if you want to reuse an open
64      * result set.
65      *
66      * @exception StandardException thrown if cursor finished.
67      */

68     public void openCore() throws StandardException;
69
70     /**
71      * reopen the scan. behaves like openCore() but is
72      * optimized where appropriate (e.g. where scanController
73      * has special logic for us).
74      * <p>
75      * used by joiners
76      * <p>
77      * scan parameters are evaluated
78      * at each open, so there is probably some way of altering
79      * their values...
80      *
81      * @exception StandardException thrown if cursor finished.
82      */

83     public void reopenCore() throws StandardException;
84
85     /**
86      * Return the requested values computed
87      * from the next row (if any) for which
88      * the restriction evaluates to true.
89      * <p>
90      * restriction and projection parameters
91      * are evaluated for each row.
92      *
93      * @exception StandardException thrown on failure.
94      *
95      * @return the next row in the result
96      */

97     public ExecRow getNextRowCore() throws StandardException;
98
99     /**
100      * Return the point of attachment for this subquery.
101      * (Only meaningful for Any and Once ResultSets, which can and will only
102      * be at the top of a ResultSet for a subquery.)
103      *
104      * @return int Point of attachment (result set number) for this
105      * subquery. (-1 if not a subquery - also Sanity violation)
106      */

107     public int getPointOfAttachment();
108
109     /**
110      * Return the isolation level of the scan in the result set.
111      * Only expected to be called for those ResultSets that
112      * contain a scan.
113      *
114      * @return The isolation level of the scan (in TransactionController constants).
115      */

116     public int getScanIsolationLevel();
117
118     /**
119      * Notify a NPRS that it is the source for the specified
120      * TargetResultSet. This is useful when doing bulk insert.
121      *
122      * @param trs The TargetResultSet.
123      */

124     public void setTargetResultSet(TargetResultSet trs);
125
126     /**
127      * Set whether or not the NPRS need the row location when acting
128      * as a row source. (The target result set determines this.)
129      */

130     public void setNeedsRowLocation(boolean needsRowLocation);
131
132     /**
133      * Get the estimated row count from this result set.
134      *
135      * @return The estimated row count (as a double) from this result set.
136      */

137     public double getEstimatedRowCount();
138
139     /**
140      * Get the number of this ResultSet, which is guaranteed to be unique
141      * within a statement.
142      */

143     public int resultSetNumber();
144
145     /**
146      * Set the current row to the row passed in.
147      *
148      * @param row the new current row
149      *
150      */

151     public void setCurrentRow(ExecRow row);
152
153     /**
154      * Do we need to relock the row when going to the heap.
155      *
156      * @return Whether or not we need to relock the row when going to the heap.
157      */

158
159     public boolean requiresRelocking();
160     
161     /**
162      * Is this ResultSet or it's source result set for update
163      *
164      * @return Whether or not the result set is for update.
165      */

166     public boolean isForUpdate();
167
168     /*
169      * New methods for supporting detectability of own changes for
170      * for updates and deletes when using ResultSets of type
171      * TYPE_SCROLL_INSENSITIVE and concurrency CONCUR_UPDATABLE.
172      */

173     
174     /**
175      * Updates the resultSet's current row with it's new values after
176      * an update has been issued either using positioned update or
177      * JDBC's udpateRow method.
178      *
179      * @param row new values for the currentRow
180      *
181      * @exception StandardException thrown on failure.
182      */

183     public void updateRow(ExecRow row) throws StandardException;
184     
185     /**
186      * Marks the resultSet's currentRow as deleted after a delete has been
187      * issued by either by using positioned delete or JDBC's deleteRow
188      * method.
189      *
190      * @exception StandardException thrown on failure.
191      */

192     public void markRowAsDeleted() throws StandardException;
193
194     /**
195      * Positions the cursor in the specified rowLocation. Used for
196      * scrollable insensitive result sets in order to position the
197      * cursor back to a row that has already be visited.
198      *
199      * @param rLoc row location of the current cursor row
200      *
201      * @exception StandardException thrown on failure to
202      * get location from storage engine
203      *
204      */

205     void positionScanAtRowLocation(RowLocation rLoc)
206         throws StandardException;}
207
Popular Tags