[766] | 1 | /* |
---|
| 2 | Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. |
---|
| 3 | |
---|
| 4 | |
---|
| 5 | The MySQL Connector/J is licensed under the terms of the GPLv2 |
---|
| 6 | <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most MySQL Connectors. |
---|
| 7 | There are special exceptions to the terms and conditions of the GPLv2 as it is applied to |
---|
| 8 | this software, see the FLOSS License Exception |
---|
| 9 | <http://www.mysql.com/about/legal/licensing/foss-exception.html>. |
---|
| 10 | |
---|
| 11 | This program is free software; you can redistribute it and/or modify it under the terms |
---|
| 12 | of the GNU General Public License as published by the Free Software Foundation; version 2 |
---|
| 13 | of the License. |
---|
| 14 | |
---|
| 15 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
---|
| 16 | without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
---|
| 17 | See the GNU General Public License for more details. |
---|
| 18 | |
---|
| 19 | You should have received a copy of the GNU General Public License along with this |
---|
| 20 | program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth |
---|
| 21 | Floor, Boston, MA 02110-1301 USA |
---|
| 22 | |
---|
| 23 | */ |
---|
| 24 | |
---|
| 25 | package com.mysql.jdbc; |
---|
| 26 | |
---|
| 27 | import java.sql.SQLException; |
---|
| 28 | |
---|
| 29 | /** |
---|
| 30 | * This interface is intended to be used by implementors of statement |
---|
| 31 | * interceptors so that implementors can create static or dynamic (via |
---|
| 32 | * java.lang.reflect.Proxy) proxy instances of ResultSets. It consists |
---|
| 33 | * of methods outside of java.sql.Result that are used internally by |
---|
| 34 | * other classes in the driver. |
---|
| 35 | * |
---|
| 36 | * This interface, although public is <strong>not</strong> designed to |
---|
| 37 | * be consumed publicly other than for the statement interceptor use case. |
---|
| 38 | * |
---|
| 39 | * @version $Id: $ |
---|
| 40 | */ |
---|
| 41 | public interface ResultSetInternalMethods extends java.sql.ResultSet { |
---|
| 42 | |
---|
| 43 | /** |
---|
| 44 | * Returns a new instance of this result set, that shares the |
---|
| 45 | * underlying row data. |
---|
| 46 | */ |
---|
| 47 | public abstract ResultSetInternalMethods copy() throws SQLException; |
---|
| 48 | |
---|
| 49 | /** |
---|
| 50 | * Does the result set contain rows, or is it the result of a DDL or DML |
---|
| 51 | * statement? |
---|
| 52 | */ |
---|
| 53 | public abstract boolean reallyResult(); |
---|
| 54 | |
---|
| 55 | /** |
---|
| 56 | * Functions like ResultSet.getObject(), but using the given SQL type |
---|
| 57 | * (as registered during CallableStatement.registerOutParameter()). |
---|
| 58 | */ |
---|
| 59 | public abstract Object getObjectStoredProc(int columnIndex, int desiredSqlType) |
---|
| 60 | throws SQLException; |
---|
| 61 | |
---|
| 62 | /** |
---|
| 63 | * Functions like ResultSet.getObject(), but using the given SQL type |
---|
| 64 | * (as registered during CallableStatement.registerOutParameter()). |
---|
| 65 | */ |
---|
| 66 | public abstract Object getObjectStoredProc(int i, java.util.Map<Object, Object> map, |
---|
| 67 | int desiredSqlType) throws SQLException; |
---|
| 68 | |
---|
| 69 | /** |
---|
| 70 | * Functions like ResultSet.getObject(), but using the given SQL type |
---|
| 71 | * (as registered during CallableStatement.registerOutParameter()). |
---|
| 72 | */ |
---|
| 73 | public abstract Object getObjectStoredProc(String columnName, int desiredSqlType) |
---|
| 74 | throws SQLException; |
---|
| 75 | |
---|
| 76 | /** |
---|
| 77 | * Functions like ResultSet.getObject(), but using the given SQL type |
---|
| 78 | * (as registered during CallableStatement.registerOutParameter()). |
---|
| 79 | */ |
---|
| 80 | public abstract Object getObjectStoredProc(String colName, java.util.Map<Object, Object> map, |
---|
| 81 | int desiredSqlType) throws SQLException; |
---|
| 82 | |
---|
| 83 | /** |
---|
| 84 | * Returns the server informational message returned from a DDL or DML |
---|
| 85 | * statement (if any), or null if none. |
---|
| 86 | */ |
---|
| 87 | public String getServerInfo(); |
---|
| 88 | |
---|
| 89 | /** |
---|
| 90 | * Returns the update count for this result set (if one exists), otherwise |
---|
| 91 | * -1. |
---|
| 92 | * |
---|
| 93 | * @ return the update count for this result set (if one exists), otherwise |
---|
| 94 | * -1. |
---|
| 95 | */ |
---|
| 96 | public long getUpdateCount(); |
---|
| 97 | |
---|
| 98 | /** |
---|
| 99 | * Returns the AUTO_INCREMENT value for the DDL/DML statement which created |
---|
| 100 | * this result set. |
---|
| 101 | * |
---|
| 102 | * @return the AUTO_INCREMENT value for the DDL/DML statement which created |
---|
| 103 | * this result set. |
---|
| 104 | */ |
---|
| 105 | public long getUpdateID(); |
---|
| 106 | |
---|
| 107 | /** |
---|
| 108 | * Closes this ResultSet and releases resources. |
---|
| 109 | * |
---|
| 110 | * @param calledExplicitly was realClose called by the standard |
---|
| 111 | * ResultSet.close() method, or was it closed internally by the driver? |
---|
| 112 | */ |
---|
| 113 | public void realClose(boolean calledExplicitly) throws SQLException; |
---|
| 114 | |
---|
| 115 | /** |
---|
| 116 | * Sets the first character of the query that was issued to create |
---|
| 117 | * this result set. The character should be upper-cased. |
---|
| 118 | */ |
---|
| 119 | public void setFirstCharOfQuery(char firstCharUpperCase); |
---|
| 120 | |
---|
| 121 | /** |
---|
| 122 | * Sets the statement that "owns" this result set (usually used when the |
---|
| 123 | * result set should internally "belong" to one statement, but is created |
---|
| 124 | * by another. |
---|
| 125 | */ |
---|
| 126 | public void setOwningStatement(com.mysql.jdbc.StatementImpl owningStatement); |
---|
| 127 | |
---|
| 128 | /** |
---|
| 129 | * Returns the first character of the query that was issued to create this |
---|
| 130 | * result set, upper-cased. |
---|
| 131 | */ |
---|
| 132 | public char getFirstCharOfQuery(); |
---|
| 133 | |
---|
| 134 | /** |
---|
| 135 | * Clears the reference to the next result set in a multi-result set |
---|
| 136 | * "chain". |
---|
| 137 | */ |
---|
| 138 | public void clearNextResult(); |
---|
| 139 | |
---|
| 140 | /** |
---|
| 141 | * Returns the next ResultSet in a multi-resultset "chain", if any, |
---|
| 142 | * null if none exists. |
---|
| 143 | */ |
---|
| 144 | public ResultSetInternalMethods getNextResultSet(); |
---|
| 145 | |
---|
| 146 | public void setStatementUsedForFetchingRows(PreparedStatement stmt); |
---|
| 147 | |
---|
| 148 | /** |
---|
| 149 | * @param wrapperStatement |
---|
| 150 | * The wrapperStatement to set. |
---|
| 151 | */ |
---|
| 152 | public void setWrapperStatement(java.sql.Statement wrapperStatement); |
---|
| 153 | |
---|
| 154 | /** |
---|
| 155 | * Builds a hash between column names and their indices for fast retrieval. |
---|
| 156 | * This is done lazily to support findColumn() and get*(String), as it |
---|
| 157 | * can be more expensive than just retrieving result set values by ordinal |
---|
| 158 | * index. |
---|
| 159 | */ |
---|
| 160 | public void buildIndexMapping() throws SQLException; |
---|
| 161 | |
---|
| 162 | public void initializeWithMetadata() throws SQLException; |
---|
| 163 | |
---|
| 164 | /** |
---|
| 165 | * Used by DatabaseMetadata implementations to coerce the metadata returned |
---|
| 166 | * by metadata queries into that required by the JDBC specification. |
---|
| 167 | * |
---|
| 168 | * @param metadataFields the coerced metadata to be applied to result sets |
---|
| 169 | * returned by "SHOW ..." or SELECTs on INFORMATION_SCHEMA performed on behalf |
---|
| 170 | * of methods in DatabaseMetadata. |
---|
| 171 | */ |
---|
| 172 | public void redefineFieldsForDBMD(Field[] metadataFields); |
---|
| 173 | |
---|
| 174 | public void populateCachedMetaData(CachedResultSetMetaData cachedMetaData) throws SQLException; |
---|
| 175 | |
---|
| 176 | public void initializeFromCachedMetaData(CachedResultSetMetaData cachedMetaData); |
---|
| 177 | |
---|
| 178 | public int getBytesSize() throws SQLException; |
---|
| 179 | } |
---|