001: /*
002: * $Id: UnmodifiableResultSet.java,v 1.2 2007/11/13 19:04:01 rwald Exp $
003: * =======================================================================
004: * Copyright (c) 2005 Axion Development Team. All rights reserved.
005: *
006: * Redistribution and use in source and binary forms, with or without
007: * modification, are permitted provided that the following conditions
008: * are met:
009: *
010: * 1. Redistributions of source code must retain the above
011: * copyright notice, this list of conditions and the following
012: * disclaimer.
013: *
014: * 2. Redistributions in binary form must reproduce the above copyright
015: * notice, this list of conditions and the following disclaimer in
016: * the documentation and/or other materials provided with the
017: * distribution.
018: *
019: * 3. The names "Tigris", "Axion", nor the names of its contributors may
020: * not be used to endorse or promote products derived from this
021: * software without specific prior written permission.
022: *
023: * 4. Products derived from this software may not be called "Axion", nor
024: * may "Tigris" or "Axion" appear in their names without specific prior
025: * written permission.
026: *
027: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
028: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
029: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
030: * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
031: * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
032: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
033: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
034: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
035: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
036: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
037: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
038: * =======================================================================
039: */
040: package org.axiondb.jdbc;
041:
042: import java.io.InputStream;
043: import java.io.Reader;
044: import java.math.BigDecimal;
045: import java.sql.Array;
046: import java.sql.Blob;
047: import java.sql.Clob;
048: import java.sql.Date;
049: import java.sql.NClob;
050: import java.sql.Ref;
051: import java.sql.ResultSet;
052: import java.sql.RowId;
053: import java.sql.SQLException;
054: import java.sql.SQLXML;
055: import java.sql.Time;
056: import java.sql.Timestamp;
057: import java.util.Map;
058:
059: /**
060: * @author Jonathan Giron
061: * @version $Revision: 1.2 $
062: */
063: public final class UnmodifiableResultSet extends
064: BaseAxionResultSetDecorator {
065:
066: public static ResultSet decorate(ResultSet that) {
067: return (null == that) ? null
068: : (that instanceof UnmodifiableResultSet) ? that
069: : new UnmodifiableResultSet(that);
070: }
071:
072: /**
073: * @param rs ResultSet that need to be decorated
074: */
075: public UnmodifiableResultSet(ResultSet rs) {
076: super (rs);
077: }
078:
079: public void cancelRowUpdates() throws SQLException {
080: throw new SQLException("Read-only ResultSet - not supported.");
081: }
082:
083: public void deleteRow() throws SQLException {
084: throw new SQLException("Read-only ResultSet - not supported.");
085: }
086:
087: public void insertRow() throws SQLException {
088: throw new SQLException("Read-only ResultSet - not supported.");
089: }
090:
091: public void moveToCurrentRow() throws SQLException {
092: throw new SQLException("Read-only ResultSet - not supported.");
093: }
094:
095: public void moveToInsertRow() throws SQLException {
096: throw new SQLException("Read-only ResultSet - not supported.");
097: }
098:
099: public void updateArray(int columnIndex, Array x)
100: throws SQLException {
101: throw new SQLException("Read-only ResultSet - not supported.");
102: }
103:
104: public void updateArray(String columnName, Array x)
105: throws SQLException {
106: throw new SQLException("Read-only ResultSet - not supported.");
107: }
108:
109: public void updateAsciiStream(int columnIndex, InputStream x,
110: int length) throws SQLException {
111: throw new SQLException("Read-only ResultSet - not supported.");
112: }
113:
114: public void updateAsciiStream(String columnName, InputStream x,
115: int length) throws SQLException {
116: throw new SQLException("Read-only ResultSet - not supported.");
117: }
118:
119: public void updateBigDecimal(int columnIndex, BigDecimal x)
120: throws SQLException {
121: throw new SQLException("Read-only ResultSet - not supported.");
122: }
123:
124: public void updateBigDecimal(String columnName, BigDecimal x)
125: throws SQLException {
126: throw new SQLException("Read-only ResultSet - not supported.");
127: }
128:
129: public void updateBinaryStream(int columnIndex, InputStream x,
130: int length) throws SQLException {
131: throw new SQLException("Read-only ResultSet - not supported.");
132: }
133:
134: public void updateBinaryStream(String columnName, InputStream x,
135: int length) throws SQLException {
136: throw new SQLException("Read-only ResultSet - not supported.");
137: }
138:
139: public void updateBlob(int columnIndex, Blob x) throws SQLException {
140: throw new SQLException("Read-only ResultSet - not supported.");
141: }
142:
143: public void updateBlob(String columnName, Blob x)
144: throws SQLException {
145: throw new SQLException("Read-only ResultSet - not supported.");
146: }
147:
148: public void updateBoolean(int columnIndex, boolean x)
149: throws SQLException {
150: throw new SQLException("Read-only ResultSet - not supported.");
151: }
152:
153: public void updateBoolean(String columnName, boolean x)
154: throws SQLException {
155: throw new SQLException("Read-only ResultSet - not supported.");
156: }
157:
158: public void updateByte(int columnIndex, byte x) throws SQLException {
159: throw new SQLException("Read-only ResultSet - not supported.");
160: }
161:
162: public void updateByte(String columnName, byte x)
163: throws SQLException {
164: throw new SQLException("Read-only ResultSet - not supported.");
165: }
166:
167: public void updateBytes(int columnIndex, byte[] x)
168: throws SQLException {
169: throw new SQLException("Read-only ResultSet - not supported.");
170: }
171:
172: public void updateBytes(String columnName, byte[] x)
173: throws SQLException {
174: throw new SQLException("Read-only ResultSet - not supported.");
175: }
176:
177: public void updateCharacterStream(int columnIndex, Reader x,
178: int length) throws SQLException {
179: throw new SQLException("Read-only ResultSet - not supported.");
180: }
181:
182: public void updateCharacterStream(String columnName, Reader reader,
183: int length) throws SQLException {
184: throw new SQLException("Read-only ResultSet - not supported.");
185: }
186:
187: public void updateClob(int columnIndex, Clob x) throws SQLException {
188: throw new SQLException("Read-only ResultSet - not supported.");
189: }
190:
191: public void updateClob(String columnName, Clob x)
192: throws SQLException {
193: throw new SQLException("Read-only ResultSet - not supported.");
194: }
195:
196: public void updateDate(int columnIndex, Date x) throws SQLException {
197: throw new SQLException("Read-only ResultSet - not supported.");
198: }
199:
200: public void updateDate(String columnName, Date x)
201: throws SQLException {
202: throw new SQLException("Read-only ResultSet - not supported.");
203: }
204:
205: public void updateDouble(int columnIndex, double x)
206: throws SQLException {
207: throw new SQLException("Read-only ResultSet - not supported.");
208: }
209:
210: public void updateDouble(String columnName, double x)
211: throws SQLException {
212: throw new SQLException("Read-only ResultSet - not supported.");
213: }
214:
215: public void updateFloat(int columnIndex, float x)
216: throws SQLException {
217: throw new SQLException("Read-only ResultSet - not supported.");
218: }
219:
220: public void updateFloat(String columnName, float x)
221: throws SQLException {
222: throw new SQLException("Read-only ResultSet - not supported.");
223: }
224:
225: public void updateInt(int columnIndex, int x) throws SQLException {
226: throw new SQLException("Read-only ResultSet - not supported.");
227: }
228:
229: public void updateInt(String columnName, int x) throws SQLException {
230: throw new SQLException("Read-only ResultSet - not supported.");
231: }
232:
233: public void updateLong(int columnIndex, long x) throws SQLException {
234: throw new SQLException("Read-only ResultSet - not supported.");
235: }
236:
237: public void updateLong(String columnName, long x)
238: throws SQLException {
239: throw new SQLException("Read-only ResultSet - not supported.");
240: }
241:
242: public void updateNull(int columnIndex) throws SQLException {
243: throw new SQLException("Read-only ResultSet - not supported.");
244: }
245:
246: public void updateNull(String columnName) throws SQLException {
247: throw new SQLException("Read-only ResultSet - not supported.");
248: }
249:
250: public void updateObject(int columnIndex, Object x)
251: throws SQLException {
252: throw new SQLException("Read-only ResultSet - not supported.");
253: }
254:
255: public void updateObject(int columnIndex, Object x, int scale)
256: throws SQLException {
257: throw new SQLException("Read-only ResultSet - not supported.");
258: }
259:
260: public void updateObject(String columnName, Object x)
261: throws SQLException {
262: throw new SQLException("Read-only ResultSet - not supported.");
263: }
264:
265: public void updateObject(String columnName, Object x, int scale)
266: throws SQLException {
267: throw new SQLException("Read-only ResultSet - not supported.");
268: }
269:
270: public void updateRef(int columnIndex, Ref x) throws SQLException {
271: throw new SQLException("Read-only ResultSet - not supported.");
272: }
273:
274: public void updateRef(String columnName, Ref x) throws SQLException {
275: throw new SQLException("Read-only ResultSet - not supported.");
276: }
277:
278: public void updateRow() throws SQLException {
279: throw new SQLException("Read-only ResultSet - not supported.");
280: }
281:
282: public void updateShort(int columnIndex, short x)
283: throws SQLException {
284: throw new SQLException("Read-only ResultSet - not supported.");
285: }
286:
287: public void updateShort(String columnName, short x)
288: throws SQLException {
289: throw new SQLException("Read-only ResultSet - not supported.");
290: }
291:
292: public void updateString(int columnIndex, String x)
293: throws SQLException {
294: throw new SQLException("Read-only ResultSet - not supported.");
295: }
296:
297: public void updateString(String columnName, String x)
298: throws SQLException {
299: throw new SQLException("Read-only ResultSet - not supported.");
300: }
301:
302: public void updateTime(int columnIndex, Time x) throws SQLException {
303: throw new SQLException("Read-only ResultSet - not supported.");
304: }
305:
306: public void updateTime(String columnName, Time x)
307: throws SQLException {
308: throw new SQLException("Read-only ResultSet - not supported.");
309: }
310:
311: public void updateTimestamp(int columnIndex, Timestamp x)
312: throws SQLException {
313: throw new SQLException("Read-only ResultSet - not supported.");
314: }
315:
316: public void updateTimestamp(String columnName, Timestamp x)
317: throws SQLException {
318: throw new SQLException("Read-only ResultSet - not supported.");
319: }
320:
321: @Override
322: public int getHoldability() throws SQLException {
323: throw new SQLException("Not implemented");
324: }
325:
326: @Override
327: public Reader getNCharacterStream(int arg0) throws SQLException {
328: throw new SQLException("Not implemented");
329: }
330:
331: @Override
332: public Reader getNCharacterStream(String arg0) throws SQLException {
333: throw new SQLException("Not implemented");
334: }
335:
336: @Override
337: public NClob getNClob(int arg0) throws SQLException {
338: throw new SQLException("Not implemented");
339: }
340:
341: @Override
342: public NClob getNClob(String arg0) throws SQLException {
343: throw new SQLException("Not implemented");
344: }
345:
346: @Override
347: public String getNString(int arg0) throws SQLException {
348: throw new SQLException("Not implemented");
349: }
350:
351: @Override
352: public String getNString(String arg0) throws SQLException {
353: throw new SQLException("Not implemented");
354: }
355:
356: @Override
357: public Object getObject(int arg0, Map arg1) throws SQLException {
358: throw new SQLException("Not implemented");
359: }
360:
361: @Override
362: public Object getObject(String arg0, Map arg1) throws SQLException {
363: throw new SQLException("Not implemented");
364: }
365:
366: @Override
367: public RowId getRowId(int arg0) throws SQLException {
368: throw new SQLException("Not implemented");
369: }
370:
371: @Override
372: public RowId getRowId(String arg0) throws SQLException {
373: throw new SQLException("Not implemented");
374: }
375:
376: @Override
377: public SQLXML getSQLXML(int arg0) throws SQLException {
378: throw new SQLException("Not implemented");
379: }
380:
381: @Override
382: public SQLXML getSQLXML(String arg0) throws SQLException {
383: throw new SQLException("Not implemented");
384: }
385:
386: @Override
387: public boolean isClosed() throws SQLException {
388: throw new SQLException("Not implemented");
389: }
390:
391: @Override
392: public void updateAsciiStream(int arg0, InputStream arg1)
393: throws SQLException {
394: throw new SQLException("Not implemented");
395:
396: }
397:
398: @Override
399: public void updateAsciiStream(String arg0, InputStream arg1)
400: throws SQLException {
401: throw new SQLException("Not implemented");
402:
403: }
404:
405: @Override
406: public void updateAsciiStream(int arg0, InputStream arg1, long arg2)
407: throws SQLException {
408: throw new SQLException("Not implemented");
409:
410: }
411:
412: @Override
413: public void updateAsciiStream(String arg0, InputStream arg1,
414: long arg2) throws SQLException {
415: throw new SQLException("Not implemented");
416:
417: }
418:
419: @Override
420: public void updateBinaryStream(int arg0, InputStream arg1)
421: throws SQLException {
422: throw new SQLException("Not implemented");
423:
424: }
425:
426: @Override
427: public void updateBinaryStream(String arg0, InputStream arg1)
428: throws SQLException {
429: throw new SQLException("Not supported");
430: }
431:
432: @Override
433: public void updateBinaryStream(int arg0, InputStream arg1, long arg2)
434: throws SQLException {
435: throw new SQLException("Not supported");
436: }
437:
438: @Override
439: public void updateBinaryStream(String arg0, InputStream arg1,
440: long arg2) throws SQLException {
441: throw new SQLException("Not supported");
442: }
443:
444: @Override
445: public void updateBlob(int arg0, InputStream arg1)
446: throws SQLException {
447: throw new SQLException("Not supported");
448: }
449:
450: @Override
451: public void updateBlob(String arg0, InputStream arg1)
452: throws SQLException {
453: throw new SQLException("Not supported");
454: }
455:
456: @Override
457: public void updateBlob(int arg0, InputStream arg1, long arg2)
458: throws SQLException {
459: throw new SQLException("Not supported");
460: }
461:
462: @Override
463: public void updateBlob(String arg0, InputStream arg1, long arg2)
464: throws SQLException {
465: throw new SQLException("Not supported");
466: }
467:
468: @Override
469: public void updateCharacterStream(int arg0, Reader arg1)
470: throws SQLException {
471: throw new SQLException("Not implemented");
472:
473: }
474:
475: @Override
476: public void updateCharacterStream(String arg0, Reader arg1)
477: throws SQLException {
478: throw new SQLException("Not implemented");
479:
480: }
481:
482: @Override
483: public void updateCharacterStream(int arg0, Reader arg1, long arg2)
484: throws SQLException {
485: throw new SQLException("Not implemented");
486:
487: }
488:
489: @Override
490: public void updateCharacterStream(String arg0, Reader arg1,
491: long arg2) throws SQLException {
492: throw new SQLException("Not implemented");
493:
494: }
495:
496: @Override
497: public void updateClob(int arg0, Reader arg1) throws SQLException {
498: throw new SQLException("Not implemented");
499:
500: }
501:
502: @Override
503: public void updateClob(String arg0, Reader arg1)
504: throws SQLException {
505: throw new SQLException("Not implemented");
506:
507: }
508:
509: @Override
510: public void updateClob(int arg0, Reader arg1, long arg2)
511: throws SQLException {
512: throw new SQLException("Not implemented");
513:
514: }
515:
516: @Override
517: public void updateClob(String arg0, Reader arg1, long arg2)
518: throws SQLException {
519: throw new SQLException("Not implemented");
520:
521: }
522:
523: @Override
524: public void updateNCharacterStream(int arg0, Reader arg1)
525: throws SQLException {
526: throw new SQLException("Not implemented");
527:
528: }
529:
530: @Override
531: public void updateNCharacterStream(String arg0, Reader arg1)
532: throws SQLException {
533: throw new SQLException("Not implemented");
534:
535: }
536:
537: @Override
538: public void updateNCharacterStream(int arg0, Reader arg1, long arg2)
539: throws SQLException {
540: throw new SQLException("Not implemented");
541:
542: }
543:
544: @Override
545: public void updateNCharacterStream(String arg0, Reader arg1,
546: long arg2) throws SQLException {
547: throw new SQLException("Not implemented");
548:
549: }
550:
551: @Override
552: public void updateNClob(int arg0, NClob arg1) throws SQLException {
553: throw new SQLException("Not implemented");
554:
555: }
556:
557: @Override
558: public void updateNClob(String arg0, NClob arg1)
559: throws SQLException {
560: throw new SQLException("Not implemented");
561:
562: }
563:
564: @Override
565: public void updateNClob(int arg0, Reader arg1) throws SQLException {
566: throw new SQLException("Not implemented");
567:
568: }
569:
570: @Override
571: public void updateNClob(String arg0, Reader arg1)
572: throws SQLException {
573: throw new SQLException("Not implemented");
574:
575: }
576:
577: @Override
578: public void updateNClob(int arg0, Reader arg1, long arg2)
579: throws SQLException {
580: throw new SQLException("Not implemented");
581:
582: }
583:
584: @Override
585: public void updateNClob(String arg0, Reader arg1, long arg2)
586: throws SQLException {
587: throw new SQLException("Not implemented");
588:
589: }
590:
591: @Override
592: public void updateNString(int arg0, String arg1)
593: throws SQLException {
594: throw new SQLException("Not implemented");
595:
596: }
597:
598: @Override
599: public void updateNString(String arg0, String arg1)
600: throws SQLException {
601: throw new SQLException("Not implemented");
602:
603: }
604:
605: @Override
606: public void updateRowId(int arg0, RowId arg1) throws SQLException {
607: throw new SQLException("Not implemented");
608:
609: }
610:
611: @Override
612: public void updateRowId(String arg0, RowId arg1)
613: throws SQLException {
614: throw new SQLException("Not implemented");
615:
616: }
617:
618: @Override
619: public void updateSQLXML(int arg0, SQLXML arg1) throws SQLException {
620: throw new SQLException("Not implemented");
621:
622: }
623:
624: @Override
625: public void updateSQLXML(String arg0, SQLXML arg1)
626: throws SQLException {
627: throw new SQLException("Not implemented");
628:
629: }
630:
631: @Override
632: public boolean isWrapperFor(Class<?> arg0) throws SQLException {
633: throw new SQLException("Not implemented");
634: }
635:
636: @Override
637: public <T> T unwrap(Class<T> arg0) throws SQLException {
638: throw new SQLException("Not implemented");
639: }
640: }
|