001: /*
002:
003: Derby - Class org.apache.derby.impl.jdbc.EmbedResultSet40
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.impl.jdbc;
023:
024: import org.apache.derby.iapi.sql.ResultSet;
025:
026: import java.io.Reader;
027: import java.sql.NClob;
028: import java.sql.RowId;
029: import java.sql.SQLException;
030: import java.sql.SQLXML;
031: import java.sql.Statement;
032:
033: import org.apache.derby.iapi.reference.SQLState;
034:
035: /**
036: * JDBC 4 specific methods that cannot be implemented in superclasses and
037: * unimplemented JDBC 4 methods.
038: * In general, the implementations should be pushed to the superclasses. This
039: * is not possible if the methods use objects or features not available in the
040: * Java version associated with the earlier JDBC version, since Derby classes
041: * are compiled with the lowest possible Java version.
042: */
043: public class EmbedResultSet40 extends
044: org.apache.derby.impl.jdbc.EmbedResultSet20 {
045:
046: /** Creates a new instance of EmbedResultSet40 */
047: public EmbedResultSet40(
048: org.apache.derby.impl.jdbc.EmbedConnection conn,
049: ResultSet resultsToWrap, boolean forMetaData,
050: org.apache.derby.impl.jdbc.EmbedStatement stmt,
051: boolean isAtomic) throws SQLException {
052:
053: super (conn, resultsToWrap, forMetaData, stmt, isAtomic);
054: }
055:
056: public RowId getRowId(int columnIndex) throws SQLException {
057: throw Util.notImplemented();
058: }
059:
060: public RowId getRowId(String columnName) throws SQLException {
061: throw Util.notImplemented();
062: }
063:
064: public void updateNCharacterStream(int columnIndex, Reader x)
065: throws SQLException {
066: throw Util.notImplemented();
067: }
068:
069: public void updateNCharacterStream(int columnIndex, Reader x,
070: long length) throws SQLException {
071: throw Util.notImplemented();
072: }
073:
074: public void updateNCharacterStream(String columnName, Reader x)
075: throws SQLException {
076: throw Util.notImplemented();
077: }
078:
079: public void updateNCharacterStream(String columnName, Reader x,
080: long length) throws SQLException {
081: throw Util.notImplemented();
082: }
083:
084: public void updateNString(int columnIndex, String nString)
085: throws SQLException {
086: throw Util.notImplemented();
087: }
088:
089: public void updateNString(String columnName, String nString)
090: throws SQLException {
091: throw Util.notImplemented();
092: }
093:
094: public void updateNClob(int columnIndex, NClob nClob)
095: throws SQLException {
096: throw Util.notImplemented();
097: }
098:
099: public void updateNClob(int columnIndex, Reader reader)
100: throws SQLException {
101: throw Util.notImplemented();
102: }
103:
104: public void updateNClob(String columnName, NClob nClob)
105: throws SQLException {
106: throw Util.notImplemented();
107: }
108:
109: public void updateNClob(String columnName, Reader reader)
110: throws SQLException {
111: throw Util.notImplemented();
112: }
113:
114: public Reader getNCharacterStream(int columnIndex)
115: throws SQLException {
116: throw Util.notImplemented();
117: }
118:
119: public Reader getNCharacterStream(String columnName)
120: throws SQLException {
121: throw Util.notImplemented();
122: }
123:
124: public NClob getNClob(int i) throws SQLException {
125: throw Util.notImplemented();
126: }
127:
128: public NClob getNClob(String colName) throws SQLException {
129: throw Util.notImplemented();
130: }
131:
132: public String getNString(int columnIndex) throws SQLException {
133: throw Util.notImplemented();
134: }
135:
136: public String getNString(String columnName) throws SQLException {
137: throw Util.notImplemented();
138: }
139:
140: public void updateRowId(int columnIndex, RowId x)
141: throws SQLException {
142: throw Util.notImplemented();
143: }
144:
145: public void updateRowId(String columnName, RowId x)
146: throws SQLException {
147: throw Util.notImplemented();
148: }
149:
150: public SQLXML getSQLXML(int columnIndex) throws SQLException {
151: throw Util.notImplemented();
152: }
153:
154: public SQLXML getSQLXML(String colName) throws SQLException {
155: throw Util.notImplemented();
156: }
157:
158: public void updateSQLXML(int columnIndex, SQLXML xmlObject)
159: throws SQLException {
160: throw Util.notImplemented();
161: }
162:
163: public void updateSQLXML(String columnName, SQLXML xmlObject)
164: throws SQLException {
165: throw Util.notImplemented();
166: }
167:
168: /**
169: * Returns false unless <code>interfaces</code> is implemented
170: *
171: * @param interfaces a Class defining an interface.
172: * @return true if this implements the interface or
173: * directly or indirectly wraps an object
174: * that does.
175: * @throws java.sql.SQLException if an error occurs while determining
176: * whether this is a wrapper for an object
177: * with the given interface.
178: */
179: public boolean isWrapperFor(Class<?> interfaces)
180: throws SQLException {
181: checkIfClosed("isWrapperFor");
182: return interfaces.isInstance(this );
183: }
184:
185: /**
186: * Returns <code>this</code> if this class implements the interface
187: *
188: * @param interfaces a Class defining an interface
189: * @return an object that implements the interface
190: * @throws java.sql.SQLExption if no object if found that implements the
191: * interface
192: */
193: public <T> T unwrap(java.lang.Class<T> interfaces)
194: throws SQLException {
195: checkIfClosed("unwrap");
196: //Derby does not implement non-standard methods on
197: //JDBC objects
198: //hence return this if this class implements the interface
199: //or throw an SQLException
200: try {
201: return interfaces.cast(this );
202: } catch (ClassCastException cce) {
203: throw newSQLException(SQLState.UNABLE_TO_UNWRAP, interfaces);
204: }
205: }
206:
207: /**
208: *
209: * Updates the designated column using the given Reader object,
210: * which is the given number of characters long.
211: *
212: * @param columnIndex -
213: * the first column is 1, the second is 2
214: * @param x -
215: * the new column value
216: * @param length -
217: * the length of the stream
218: *
219: * @exception SQLException
220: * Feature not implemented for now.
221: */
222: public void updateNClob(int columnIndex, Reader x, long length)
223: throws SQLException {
224: throw Util.notImplemented();
225: }
226:
227: /**
228: * Updates the designated column using the given Reader object,
229: * which is the given number of characters long.
230: *
231: * @param columnName -
232: * the Name of the column to be updated
233: * @param x -
234: * the new column value
235: * @param length -
236: * the length of the stream
237: *
238: * @exception SQLException
239: * Feature not implemented for now.
240: *
241: */
242: public void updateNClob(String columnName, Reader x, long length)
243: throws SQLException {
244: throw Util.notImplemented();
245: }
246: }
|