--- /dev/null
+/*\r
+\r
+ Derby - Class org.apache.derby.iapi.sql.execute.NoPutResultSet\r
+\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to you under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+ */\r
+\r
+package org.apache.derby.iapi.sql.execute;\r
+\r
+import org.apache.derby.iapi.sql.ResultSet;\r
+import org.apache.derby.iapi.error.StandardException;\r
+\r
+import org.apache.derby.iapi.types.RowLocation;\r
+import org.apache.derby.iapi.store.access.RowLocationRetRowSource;\r
+\r
+/**\r
+ * The NoPutResultSet interface is used to provide additional\r
+ * operations on result sets that can be used in returning rows\r
+ * up a ResultSet tree.\r
+ * <p>\r
+ * Since the ResulSet operations must also be supported by\r
+ * NoPutResultSets, we extend that interface here as well.\r
+ *\r
+ */\r
+public interface NoPutResultSet extends ResultSet, RowLocationRetRowSource \r
+{\r
+ // method names for use with SQLState.LANG_RESULT_SET_NOT_OPEN exception\r
+\r
+ public static final String ABSOLUTE = "absolute";\r
+ public static final String RELATIVE = "relative";\r
+ public static final String FIRST = "first";\r
+ public static final String NEXT = "next";\r
+ public static final String LAST = "last";\r
+ public static final String PREVIOUS = "previous";\r
+\r
+ /**\r
+ * Mark the ResultSet as the topmost one in the ResultSet tree.\r
+ * Useful for closing down the ResultSet on an error.\r
+ */\r
+ public void markAsTopResultSet();\r
+\r
+ /**\r
+ * open a scan on the table. scan parameters are evaluated\r
+ * at each open, so there is probably some way of altering\r
+ * their values...\r
+ * <p>\r
+ * openCore() can only be called on a closed result\r
+ * set. see reopenCore if you want to reuse an open\r
+ * result set.\r
+ *\r
+ * @exception StandardException thrown if cursor finished.\r
+ */\r
+ public void openCore() throws StandardException;\r
+\r
+ /**\r
+ * reopen the scan. behaves like openCore() but is \r
+ * optimized where appropriate (e.g. where scanController\r
+ * has special logic for us). \r
+ * <p>\r
+ * used by joiners\r
+ * <p>\r
+ * scan parameters are evaluated\r
+ * at each open, so there is probably some way of altering\r
+ * their values... \r
+ *\r
+ * @exception StandardException thrown if cursor finished.\r
+ */\r
+ public void reopenCore() throws StandardException;\r
+\r
+ /**\r
+ * Return the requested values computed\r
+ * from the next row (if any) for which\r
+ * the restriction evaluates to true.\r
+ * <p>\r
+ * restriction and projection parameters\r
+ * are evaluated for each row.\r
+ *\r
+ * @exception StandardException thrown on failure.\r
+ *\r
+ * @return the next row in the result\r
+ */\r
+ public ExecRow getNextRowCore() throws StandardException;\r
+\r
+ /**\r
+ * Return the point of attachment for this subquery.\r
+ * (Only meaningful for Any and Once ResultSets, which can and will only\r
+ * be at the top of a ResultSet for a subquery.)\r
+ *\r
+ * @return int Point of attachment (result set number) for this\r
+ * subquery. (-1 if not a subquery - also Sanity violation)\r
+ */\r
+ public int getPointOfAttachment();\r
+\r
+ /**\r
+ * Return the isolation level of the scan in the result set.\r
+ * Only expected to be called for those ResultSets that\r
+ * contain a scan.\r
+ *\r
+ * @return The isolation level of the scan (in TransactionController constants).\r
+ */\r
+ public int getScanIsolationLevel();\r
+\r
+ /**\r
+ * Notify a NPRS that it is the source for the specified \r
+ * TargetResultSet. This is useful when doing bulk insert.\r
+ *\r
+ * @param trs The TargetResultSet.\r
+ */\r
+ public void setTargetResultSet(TargetResultSet trs);\r
+\r
+ /**\r
+ * Set whether or not the NPRS need the row location when acting\r
+ * as a row source. (The target result set determines this.)\r
+ */\r
+ public void setNeedsRowLocation(boolean needsRowLocation);\r
+\r
+ /**\r
+ * Get the estimated row count from this result set.\r
+ *\r
+ * @return The estimated row count (as a double) from this result set.\r
+ */\r
+ public double getEstimatedRowCount();\r
+\r
+ /**\r
+ * Get the number of this ResultSet, which is guaranteed to be unique\r
+ * within a statement.\r
+ */\r
+ public int resultSetNumber();\r
+\r
+ /**\r
+ * Set the current row to the row passed in.\r
+ *\r
+ * @param row the new current row\r
+ *\r
+ */\r
+ public void setCurrentRow(ExecRow row);\r
+\r
+ /**\r
+ * Do we need to relock the row when going to the heap.\r
+ *\r
+ * @return Whether or not we need to relock the row when going to the heap.\r
+ */\r
+\r
+ public boolean requiresRelocking();\r
+ \r
+ /**\r
+ * Is this ResultSet or it's source result set for update\r
+ *\r
+ * @return Whether or not the result set is for update.\r
+ */\r
+ public boolean isForUpdate();\r
+\r
+ /* \r
+ * New methods for supporting detectability of own changes for\r
+ * for updates and deletes when using ResultSets of type \r
+ * TYPE_SCROLL_INSENSITIVE and concurrency CONCUR_UPDATABLE.\r
+ */\r
+ \r
+ /**\r
+ * Updates the resultSet's current row with it's new values after\r
+ * an update has been issued either using positioned update or\r
+ * JDBC's udpateRow method.\r
+ *\r
+ * @param row new values for the currentRow\r
+ *\r
+ * @exception StandardException thrown on failure.\r
+ */\r
+ public void updateRow(ExecRow row) throws StandardException;\r
+ \r
+ /**\r
+ * Marks the resultSet's currentRow as deleted after a delete has been \r
+ * issued by either by using positioned delete or JDBC's deleteRow\r
+ * method.\r
+ *\r
+ * @exception StandardException thrown on failure.\r
+ */\r
+ public void markRowAsDeleted() throws StandardException;\r
+\r
+ /**\r
+ * Positions the cursor in the specified rowLocation. Used for\r
+ * scrollable insensitive result sets in order to position the\r
+ * cursor back to a row that has already be visited.\r
+ * \r
+ * @param rLoc row location of the current cursor row\r
+ *\r
+ * @exception StandardException thrown on failure to\r
+ * get location from storage engine\r
+ *\r
+ */\r
+ void positionScanAtRowLocation(RowLocation rLoc) \r
+ throws StandardException;}\r