--- /dev/null
+/*\r
+\r
+ Derby - Class org.apache.derby.iapi.sql.ResultDescription\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;\r
+\r
+/**\r
+ * The ResultDescription interface provides methods to get metadata on the\r
+ * results returned by a statement.\r
+ *\r
+ */\r
+\r
+public interface ResultDescription\r
+{\r
+ /**\r
+ * Returns an identifier that tells what type of statement has been\r
+ * executed. This can be used to determine what other methods to call\r
+ * to get the results back from a statement. For example, a SELECT\r
+ * statement returns rows and columns, while other statements don't,\r
+ * so you would only call getColumnCount() or getColumnType() for\r
+ * SELECT statements.\r
+ *\r
+ * @return A String identifier telling what type of statement this\r
+ * is.\r
+ */\r
+ String getStatementType(); \r
+\r
+ /**\r
+ * Returns the number of columns in the result set.\r
+ *\r
+ * @return The number of columns in the result set.\r
+ */\r
+ int getColumnCount();\r
+\r
+ /**\r
+ Return information about all the columns.\r
+ */\r
+ public ResultColumnDescriptor[] getColumnInfo();\r
+\r
+ /**\r
+ * Returns a ResultColumnDescriptor for the column, given the ordiinal\r
+ * position of the column.\r
+ * NOTE - position is 1-based.\r
+ *\r
+ * @param position The oridinal position of a column in the\r
+ * ResultSet.\r
+ *\r
+ * @return A ResultColumnDescriptor describing the\r
+ * column in the ResultSet.\r
+ */\r
+ ResultColumnDescriptor getColumnDescriptor(int position);\r
+\r
+ /**\r
+ * Get a new result description that has been truncated\r
+ * from input column number. If the input column is\r
+ * 5, then columns 5 to getColumnCount() are removed.\r
+ * The new ResultDescription points to the same\r
+ * ColumnDescriptors (this method performs a shallow\r
+ * copy. The saved JDBC ResultSetMetaData will\r
+ * not be copied.\r
+ *\r
+ * @param truncateFrom the starting column to remove,\r
+ * 1-based.\r
+ *\r
+ * @return a new ResultDescription\r
+ */\r
+ public ResultDescription truncateColumns(int truncateFrom);\r
+ \r
+ /**\r
+ * Set the JDBC ResultSetMetaData for this ResultDescription.\r
+ * A ResultSetMetaData object can be saved in the statement\r
+ * plan using this method. This only works while\r
+ * the ResultSetMetaData api does not contain a getConnection()\r
+ * method or a close method.\r
+ * <BR>\r
+ * If this object already has a saved meta data object\r
+ * this call will do nothing.\r
+ * Due to synchronization the saved ResultSetMetaData\r
+ * object may not be the one passed in, ie. if two\r
+ * threads call this concurrently, only one will be saved.\r
+ * It is assumed the JDBC layer passes in a ResultSetMetaData\r
+ * object based upon this.\r
+ */\r
+ public void setMetaData(java.sql.ResultSetMetaData rsmd);\r
+ \r
+ /**\r
+ * Get the saved JDBC ResultSetMetaData. Will return\r
+ * null if setMetaData() has not been called on this\r
+ * object. The caller then should manufacture a\r
+ * ResultSetMetaData object and pass it into setMetaData.\r
+ */\r
+ public java.sql.ResultSetMetaData getMetaData();\r
+ \r
+ /**\r
+ * Return the position of the column matching the\r
+ * passed in names following the JDBC rules for\r
+ * ResultSet.getXXX and updateXXX.\r
+ * Rules are the matching is case insensitive\r
+ * and the insensitive name matches the first\r
+ * column found that matches (starting at postion 1).\r
+ * @param name\r
+ * @return Position of the column (1-based), -1 if no match.\r
+ */\r
+ public int findColumnInsenstive(String name);\r
+}\r