001: /*
002:
003: Derby - Class org.apache.derby.client.net.NetResultSet40
004:
005: Licensed to the Apache Software Foundation (ASF) under one or more
006: contributor license agreements. See the NOTICE file distributed with
007: this work for additional information regarding copyright ownership.
008: The ASF licenses this file to You under the Apache License, Version 2.0
009: (the "License"); you may not use this file except in compliance with
010: the License. You may obtain a copy of the License at
011:
012: http://www.apache.org/licenses/LICENSE-2.0
013:
014: Unless required by applicable law or agreed to in writing, software
015: distributed under the License is distributed on an "AS IS" BASIS,
016: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: See the License for the specific language governing permissions and
018: limitations under the License.
019:
020: */
021:
022: package org.apache.derby.client.net;
023:
024: import java.io.InputStream;
025: import java.io.Reader;
026: import java.sql.NClob;
027: import java.sql.RowId;
028: import java.sql.SQLException;
029: import java.sql.SQLXML;
030: import org.apache.derby.client.am.SQLExceptionFactory;
031: import org.apache.derby.iapi.sql.ResultSet;
032: import org.apache.derby.client.am.Cursor;
033: import org.apache.derby.client.am.ClientMessageId;
034: import org.apache.derby.client.am.SqlException;
035: import org.apache.derby.shared.common.reference.SQLState;
036:
037: public class NetResultSet40 extends NetResultSet {
038:
039: NetResultSet40(
040: NetAgent netAgent,
041: NetStatement netStatement,
042: Cursor cursor,
043: int qryprctyp, //protocolType, CodePoint.FIXROWPRC |
044: // CodePoint.LMTBLKPRC
045: int sqlcsrhld, // holdOption, 0xF0 for false (default) | 0xF1 for true.
046: int qryattscr, // scrollOption, 0xF0 for false (default) | 0xF1 for true.
047: int qryattsns, // sensitivity, CodePoint.QRYUNK |
048: // CodePoint.QRYINS |
049: // CodePoint.QRYSNSSTC
050: int qryattset, // rowsetCursor, 0xF0 for false (default) | 0xF1 for true.
051: long qryinsid, // instanceIdentifier, 0 (if not returned, check default) or number
052: int actualResultSetType, int actualResultSetConcurrency,
053: int actualResultSetHoldability) //throws DisconnectException
054: {
055: super (netAgent, netStatement, cursor, qryprctyp, sqlcsrhld,
056: qryattscr, qryattsns, qryattset, qryinsid,
057: actualResultSetType, actualResultSetConcurrency,
058: actualResultSetHoldability);
059: }
060:
061: public Reader getNCharacterStream(int columnIndex)
062: throws SQLException {
063: throw SQLExceptionFactory
064: .notImplemented("getNCharacterStream(int)");
065: }
066:
067: public Reader getNCharacterStream(String columnName)
068: throws SQLException {
069: throw SQLExceptionFactory
070: .notImplemented("getNCharacterStream(String)");
071: }
072:
073: public String getNString(int columnIndex) throws SQLException {
074: throw SQLExceptionFactory.notImplemented("getNString(int)");
075: }
076:
077: public String getNString(String columnName) throws SQLException {
078: throw SQLExceptionFactory.notImplemented("getNString(String)");
079: }
080:
081: public RowId getRowId(int columnIndex) throws SQLException {
082: throw SQLExceptionFactory.notImplemented("getRowId (int)");
083: }
084:
085: public RowId getRowId(String columnName) throws SQLException {
086: throw SQLExceptionFactory.notImplemented("getRowId (String)");
087: }
088:
089: public void updateRowId(int columnIndex, RowId x)
090: throws SQLException {
091: throw SQLExceptionFactory
092: .notImplemented("updateRowId (int, RowId)");
093: }
094:
095: public void updateRowId(String columnName, RowId x)
096: throws SQLException {
097: throw SQLExceptionFactory
098: .notImplemented("updateRowId (String, RowId)");
099: }
100:
101: public void updateNString(int columnIndex, String nString)
102: throws SQLException {
103: throw SQLExceptionFactory
104: .notImplemented("updateNString (int, String)");
105: }
106:
107: public void updateNString(String columnName, String nString)
108: throws SQLException {
109: throw SQLExceptionFactory
110: .notImplemented("updateNString (String, String)");
111: }
112:
113: public void updateNCharacterStream(int columnIndex, Reader x,
114: long length) throws SQLException {
115: throw SQLExceptionFactory
116: .notImplemented("updateNCharacterStream(int,Reader,long)");
117: }
118:
119: public void updateNCharacterStream(String columnName, Reader x,
120: long length) throws SQLException {
121: throw SQLExceptionFactory
122: .notImplemented("updateNCharacterStream(String,Reader,long)");
123: }
124:
125: public void updateNClob(int columnIndex, NClob nClob)
126: throws SQLException {
127: throw SQLExceptionFactory
128: .notImplemented("updateNClob (int, NClob)");
129: }
130:
131: public void updateNClob(String columnName, NClob nClob)
132: throws SQLException {
133: throw SQLExceptionFactory
134: .notImplemented("updateNClob (String, NClob)");
135: }
136:
137: public NClob getNClob(int i) throws SQLException {
138: throw SQLExceptionFactory.notImplemented("getNClob (int)");
139: }
140:
141: public NClob getNClob(String colName) throws SQLException {
142: throw SQLExceptionFactory.notImplemented("getNClob (String)");
143: }
144:
145: public SQLXML getSQLXML(int columnIndex) throws SQLException {
146: throw SQLExceptionFactory.notImplemented("getSQLXML (int)");
147: }
148:
149: public SQLXML getSQLXML(String colName) throws SQLException {
150: throw SQLExceptionFactory.notImplemented("getSQLXML (String)");
151: }
152:
153: public void updateSQLXML(int columnIndex, SQLXML xmlObject)
154: throws SQLException {
155: throw SQLExceptionFactory
156: .notImplemented("updateSQLXML (int, SQLXML)");
157: }
158:
159: public void updateSQLXML(String columnName, SQLXML xmlObject)
160: throws SQLException {
161: throw SQLExceptionFactory
162: .notImplemented("updateSQLXML (String, SQLXML)");
163: }
164:
165: /**
166: * Returns false unless <code>interfaces</code> is implemented
167: *
168: * @param interfaces a Class defining an interface.
169: * @return true if this implements the interface or
170: * directly or indirectly wraps an object
171: * that does.
172: * @throws java.sql.SQLException if an error occurs while determining
173: * whether this is a wrapper for an object
174: * with the given interface.
175: */
176: public boolean isWrapperFor(Class<?> interfaces)
177: throws SQLException {
178: try {
179: checkForClosedResultSet();
180: } catch (SqlException se) {
181: throw se.getSQLException();
182: }
183: return interfaces.isInstance(this );
184: }
185:
186: /**
187: * Returns <code>this</code> if this class implements the interface
188: *
189: * @param interfaces a Class defining an interface
190: * @return an object that implements the interface
191: * @throws java.sql.SQLExption if no object if found that implements the
192: * interface
193: */
194: public <T> T unwrap(java.lang.Class<T> interfaces)
195: throws SQLException {
196: try {
197: checkForClosedResultSet();
198: return interfaces.cast(this );
199: } catch (ClassCastException cce) {
200: throw new SqlException(null, new ClientMessageId(
201: SQLState.UNABLE_TO_UNWRAP), interfaces)
202: .getSQLException();
203: } catch (SqlException se) {
204: throw se.getSQLException();
205: }
206: }
207:
208: /**
209: * Updates the designated column with a java.sql.Blob value. The updater
210: * methods are used to update column values in the current row or the insert
211: * row. The updater methods do not update the underlying database; instead
212: * the updateRow or insertRow methods are called to update the database.
213: *
214: * @param columnIndex -
215: * the first column is 1, the second is 2
216: * @param x -
217: * the new column value
218: * @param length -
219: * the length of the Blob datatype
220: * @exception SQLException
221: *
222: */
223: public void updateBlob(int columnIndex, InputStream x, long length)
224: throws SQLException {
225: throw SQLExceptionFactory
226: .notImplemented("updateBlob(int,InputStream,long)");
227: }
228:
229: /**
230: * Updates the designated column with a java.sql.Blob value. The updater
231: * methods are used to update column values in the current row or the insert
232: * row. The updater methods do not update the underlying database; instead
233: * the updateRow or insertRow methods are called to update the database.
234: *
235: * @param columnName -
236: * the name of the column to be updated
237: * @param x -
238: * the new column value
239: * @param length -
240: * the length of the Blob datatype
241: * @exception SQLException
242: *
243: */
244:
245: public void updateBlob(String columnName, InputStream x, long length)
246: throws SQLException {
247: throw SQLExceptionFactory
248: .notImplemented("updateBlob(String,inputStream,long)");
249: }
250:
251: /**
252: * Updates the designated column with a java.sql.Clob value. The updater
253: * methods are used to update column values in the current row or the insert
254: * row. The updater methods do not update the underlying database; instead
255: * the updateRow or insertRow methods are called to update the database.
256: *
257: * @param columnIndex -
258: * the first column is 1, the second is 2
259: * @param x -
260: * the new column value
261: * @exception SQLException
262: * Feature not implemented for now.
263: */
264: public void updateClob(int columnIndex, Reader x, long length)
265: throws SQLException {
266: throw SQLExceptionFactory
267: .notImplemented("updateClob(int,Reader,long)");
268: }
269:
270: /**
271: * Updates the designated column with a java.sql.Clob value. The updater
272: * methods are used to update column values in the current row or the insert
273: * row. The updater methods do not update the underlying database; instead
274: * the updateRow or insertRow methods are called to update the database.
275: *
276: * @param columnName -
277: * the name of the Clob column
278: * @param x -
279: * the new column value
280: * @exception SQLException
281: * Feature not implemented for now.
282: */
283:
284: public void updateClob(String columnName, InputStream x, long length)
285: throws SQLException {
286: throw SQLExceptionFactory
287: .notImplemented("updateClob(String,InputStream,long)");
288: }
289:
290: /**
291: * Updates the designated column with a java.sql.Clob value. The updater
292: * methods are used to update column values in the current row or the insert
293: * row. The updater methods do not update the underlying database; instead
294: * the updateRow or insertRow methods are called to update the database.
295: *
296: * @param columnName -
297: * the name of the Clob column
298: * @param x -
299: * the new column value
300: * @exception SQLException
301: * Feature not implemented for now.
302: */
303:
304: public void updateClob(String columnName, Reader x, long length)
305: throws SQLException {
306: throw SQLExceptionFactory
307: .notImplemented("updateClob(String,Reader,long)");
308: }
309:
310: /**
311: * Updates the designated column with a java.sql.NClob value. The updater
312: * methods are used to update column values in the current row or the insert
313: * row. The updater methods do not update the underlying database; instead
314: * the updateRow or insertRow methods are called to update the database.
315: *
316: * @param columnIndex -
317: * the first column is 1, the second is 2
318: * @param x -
319: * the new column value
320: * @exception SQLException
321: * Feature not implemented for now.
322: */
323: public void updateNClob(int columnIndex, Reader x, long length)
324: throws SQLException {
325: throw SQLExceptionFactory
326: .notImplemented("updateNClob(int,Reader,long)");
327: }
328:
329: /**
330: * Updates the designated column with a java.sql.NClob value. The updater
331: * methods are used to update column values in the current row or the insert
332: * row. The updater methods do not update the underlying database; instead
333: * the updateRow or insertRow methods are called to update the database.
334: *
335: * @param columnName -
336: * the name of the Clob column
337: * @param x -
338: * the new column value
339: * @exception SQLException
340: * Feature not implemented for now.
341: */
342:
343: public void updateNClob(String columnName, InputStream x,
344: long length) throws SQLException {
345: throw SQLExceptionFactory
346: .notImplemented("updateNClob(String,InputStream,long)");
347: }
348:
349: /**
350: * Updates the designated column with a java.sql.NClob value. The updater
351: * methods are used to update column values in the current row or the insert
352: * row. The updater methods do not update the underlying database; instead
353: * the updateRow or insertRow methods are called to update the database.
354: *
355: * @param columnName -
356: * the name of the Clob column
357: * @param x -
358: * the new column value
359: * @exception SQLException
360: * Feature not implemented for now.
361: */
362:
363: public void updateNClob(String columnName, Reader x, long length)
364: throws SQLException {
365: throw SQLExceptionFactory
366: .notImplemented("updateNClob(String,Reader,long)");
367: }
368: }
|