View Javadoc

1   
2   
3   package com.opensourceconnections.msjdbcproxy;
4   
5   import java.io.InputStream;
6   import java.io.Reader;
7   import java.math.BigDecimal;
8   import java.net.URL;
9   import java.sql.Array;
10  import java.sql.Blob;
11  import java.sql.Clob;
12  import java.sql.Date;
13  import java.sql.Ref;
14  import java.sql.ResultSet;
15  import java.sql.ResultSetMetaData;
16  import java.sql.SQLException;
17  import java.sql.SQLWarning;
18  import java.sql.Statement;
19  import java.sql.Time;
20  import java.sql.Timestamp;
21  import java.util.Calendar;
22  import java.util.Map;
23  
24  public class ResultSetProxy implements ResultSet
25  {
26      protected final Statement _statement;
27      protected final ResultSet _resultSet;
28      protected final ColumnSet _columns;
29  
30      public ResultSetProxy(Statement statement, ResultSet resultSet) throws SQLException
31      {
32          _statement = statement;
33          _resultSet = resultSet;
34          _columns = new ColumnSet(_resultSet);
35      }
36  
37      public boolean next() throws SQLException
38      {
39          return _columns.load(_resultSet.next());
40      }
41  
42      public void close() throws SQLException
43      {
44          _resultSet.close();
45      }
46  
47      public boolean wasNull() throws SQLException
48      {
49          return _columns.wasNull();
50      }
51  
52      public String getString(int columnIndex) throws SQLException
53      {
54          return _columns.getColumn(columnIndex).getString();
55      }
56  
57      public boolean getBoolean(int columnIndex) throws SQLException
58      {
59          return _columns.getColumn(columnIndex).getBoolean();
60      }
61  
62      public byte getByte(int columnIndex) throws SQLException
63      {
64          return _columns.getColumn(columnIndex).getByte();
65      }
66  
67      public short getShort(int columnIndex) throws SQLException
68      {
69          return _columns.getColumn(columnIndex).getShort();
70      }
71  
72      public int getInt(int columnIndex) throws SQLException
73      {
74          return _columns.getColumn(columnIndex).getInt();
75      }
76  
77      public long getLong(int columnIndex) throws SQLException
78      {
79          return _columns.getColumn(columnIndex).getLong();
80      }
81  
82      public float getFloat(int columnIndex) throws SQLException
83      {
84          return _columns.getColumn(columnIndex).getFloat();
85      }
86  
87      public double getDouble(int columnIndex) throws SQLException
88      {
89          return _columns.getColumn(columnIndex).getDouble();
90      }
91  
92      public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException
93      {
94          return _columns.getColumn(columnIndex).getBigDecimal(scale);
95      }
96  
97      public byte[] getBytes(int columnIndex) throws SQLException
98      {
99          return _columns.getColumn(columnIndex).getBytes();
100     }
101 
102     public Date getDate(int columnIndex) throws SQLException
103     {
104         return _columns.getColumn(columnIndex).getDate();
105     }
106 
107     public Time getTime(int columnIndex) throws SQLException
108     {
109         return _columns.getColumn(columnIndex).getTime();
110     }
111 
112     public Timestamp getTimestamp(int columnIndex) throws SQLException
113     {
114         return _columns.getColumn(columnIndex).getTimestamp();
115     }
116 
117     public InputStream getAsciiStream(int columnIndex) throws SQLException
118     {
119         return _columns.getColumn(columnIndex).getAsciiStream();
120     }
121 
122     public InputStream getUnicodeStream(int columnIndex) throws SQLException
123     {
124         return _columns.getColumn(columnIndex).getUnicodeStream();
125     }
126 
127     public InputStream getBinaryStream(int columnIndex) throws SQLException
128     {
129         return _columns.getColumn(columnIndex).getBinaryStream();
130     }
131 
132     public String getString(String columnName) throws SQLException
133     {
134         return _columns.getColumn(columnName).getString();
135     }
136 
137     public boolean getBoolean(String columnName) throws SQLException
138     {
139         return _columns.getColumn(columnName).getBoolean();
140     }
141 
142     public byte getByte(String columnName) throws SQLException
143     {
144         return _columns.getColumn(columnName).getByte();
145     }
146 
147     public short getShort(String columnName) throws SQLException
148     {
149         return _columns.getColumn(columnName).getShort();
150     }
151 
152     public int getInt(String columnName) throws SQLException
153     {
154         return _columns.getColumn(columnName).getInt();
155     }
156 
157     public long getLong(String columnName) throws SQLException
158     {
159         return _columns.getColumn(columnName).getLong();
160     }
161 
162     public float getFloat(String columnName) throws SQLException
163     {
164         return _columns.getColumn(columnName).getFloat();
165     }
166 
167     public double getDouble(String columnName) throws SQLException
168     {
169         return _columns.getColumn(columnName).getDouble();
170     }
171 
172     public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException
173     {
174         return _columns.getColumn(columnName).getBigDecimal(scale);
175     }
176 
177     public byte[] getBytes(String columnName) throws SQLException
178     {
179         return _columns.getColumn(columnName).getBytes();
180     }
181 
182     public Date getDate(String columnName) throws SQLException
183     {
184         return _columns.getColumn(columnName).getDate();
185     }
186 
187     public Time getTime(String columnName) throws SQLException
188     {
189         return _columns.getColumn(columnName).getTime();
190     }
191 
192     public Timestamp getTimestamp(String columnName) throws SQLException
193     {
194         return _columns.getColumn(columnName).getTimestamp();
195     }
196 
197     public InputStream getAsciiStream(String columnName) throws SQLException
198     {
199         return _columns.getColumn(columnName).getAsciiStream();
200     }
201 
202     public InputStream getUnicodeStream(String columnName) throws SQLException
203     {
204         return _columns.getColumn(columnName).getUnicodeStream();
205     }
206 
207     public InputStream getBinaryStream(String columnName) throws SQLException
208     {
209         return _columns.getColumn(columnName).getBinaryStream();
210     }
211 
212     public SQLWarning getWarnings() throws SQLException
213     {
214         return _resultSet.getWarnings();
215     }
216 
217     public void clearWarnings() throws SQLException
218     {
219         _resultSet.clearWarnings();
220     }
221 
222     public String getCursorName() throws SQLException
223     {
224         return _resultSet.getCursorName();
225     }
226 
227     public ResultSetMetaData getMetaData() throws SQLException
228     {
229         return _resultSet.getMetaData();
230     }
231 
232     public Object getObject(int columnIndex) throws SQLException
233     {
234         return _columns.getColumn(columnIndex).getObject();
235     }
236 
237     public Object getObject(String columnName) throws SQLException
238     {
239         return _columns.getColumn(columnName).getObject();
240     }
241 
242     public int findColumn(String columnName) throws SQLException
243     {
244         return _columns.findColumn(columnName);
245     }
246 
247     public Reader getCharacterStream(int columnIndex) throws SQLException
248     {
249         return _columns.getColumn(columnIndex).getCharacterStream();
250     }
251 
252     public Reader getCharacterStream(String columnName) throws SQLException
253     {
254         return _columns.getColumn(columnName).getCharacterStream();
255     }
256 
257     public BigDecimal getBigDecimal(int columnIndex) throws SQLException
258     {
259         return _columns.getColumn(columnIndex).getBigDecimal();
260     }
261 
262     public BigDecimal getBigDecimal(String columnName) throws SQLException
263     {
264         return _columns.getColumn(columnName).getBigDecimal();
265     }
266 
267     public boolean isBeforeFirst() throws SQLException
268     {
269         return _resultSet.isBeforeFirst();
270     }
271 
272     public boolean isAfterLast() throws SQLException
273     {
274         return _resultSet.isAfterLast();
275     }
276 
277     public boolean isFirst() throws SQLException
278     {
279         return _resultSet.isFirst();
280     }
281 
282     public boolean isLast() throws SQLException
283     {
284         return _resultSet.isLast();
285     }
286 
287     public void beforeFirst() throws SQLException
288     {
289         _resultSet.beforeFirst();
290     }
291 
292     public void afterLast() throws SQLException
293     {
294         _resultSet.afterLast();
295     }
296 
297     public boolean first() throws SQLException
298     {
299         return _columns.load(_resultSet.first());
300     }
301 
302     public boolean last() throws SQLException
303     {
304         return _columns.load(_resultSet.last());
305     }
306 
307     public int getRow() throws SQLException
308     {
309         return _resultSet.getRow();
310     }
311 
312     public boolean absolute(int row) throws SQLException
313     {
314         return _columns.load(_resultSet.absolute(row));
315     }
316 
317     public boolean relative(int rows) throws SQLException
318     {
319         return _columns.load(_resultSet.relative(rows));
320     }
321 
322     public boolean previous() throws SQLException
323     {
324         return _columns.load(_resultSet.previous());
325     }
326 
327     public void setFetchDirection(int direction) throws SQLException
328     {
329         _resultSet.setFetchDirection(direction);
330     }
331 
332     public int getFetchDirection() throws SQLException
333     {
334         return _resultSet.getFetchDirection();
335     }
336 
337     public void setFetchSize(int rows) throws SQLException
338     {
339         _resultSet.setFetchSize(rows);
340     }
341 
342     public int getFetchSize() throws SQLException
343     {
344         return _resultSet.getFetchSize();
345     }
346 
347     public int getType() throws SQLException
348     {
349         return _resultSet.getType();
350     }
351 
352     public int getConcurrency() throws SQLException
353     {
354         return _resultSet.getConcurrency();
355     }
356 
357     public boolean rowUpdated() throws SQLException
358     {
359         return _resultSet.rowUpdated();
360     }
361 
362     public boolean rowInserted() throws SQLException
363     {
364         return _resultSet.rowInserted();
365     }
366 
367     public boolean rowDeleted() throws SQLException
368     {
369         return _resultSet.rowDeleted();
370     }
371 
372     public void updateNull(int columnIndex) throws SQLException
373     {
374         _resultSet.updateNull(columnIndex);
375     }
376 
377     public void updateBoolean(int columnIndex, boolean x) throws SQLException
378     {
379         _resultSet.updateBoolean(columnIndex, x);
380     }
381 
382     public void updateByte(int columnIndex, byte x) throws SQLException
383     {
384         _resultSet.updateByte(columnIndex, x);
385     }
386 
387     public void updateShort(int columnIndex, short x) throws SQLException
388     {
389         _resultSet.updateShort(columnIndex, x);
390     }
391 
392     public void updateInt(int columnIndex, int x) throws SQLException
393     {
394         _resultSet.updateInt(columnIndex, x);
395     }
396 
397     public void updateLong(int columnIndex, long x) throws SQLException
398     {
399         _resultSet.updateLong(columnIndex, x);
400     }
401 
402     public void updateFloat(int columnIndex, float x) throws SQLException
403     {
404         _resultSet.updateFloat(columnIndex, x);
405     }
406 
407     public void updateDouble(int columnIndex, double x) throws SQLException
408     {
409         _resultSet.updateDouble(columnIndex, x);
410     }
411 
412     public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException
413     {
414         _resultSet.updateBigDecimal(columnIndex, x);
415     }
416 
417     public void updateString(int columnIndex, String x) throws SQLException
418     {
419         _resultSet.updateString(columnIndex, x);
420     }
421 
422     public void updateBytes(int columnIndex, byte x[]) throws SQLException
423     {
424         _resultSet.updateBytes(columnIndex, x);
425     }
426 
427     public void updateDate(int columnIndex, Date x) throws SQLException
428     {
429         _resultSet.updateDate(columnIndex, x);
430     }
431 
432     public void updateTime(int columnIndex, Time x) throws SQLException
433     {
434         _resultSet.updateTime(columnIndex, x);
435     }
436 
437     public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException
438     {
439         _resultSet.updateTimestamp(columnIndex, x);
440     }
441 
442     public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException
443     {
444         _resultSet.updateAsciiStream(columnIndex, x, length);
445     }
446 
447     public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException
448     {
449         _resultSet.updateBinaryStream(columnIndex, x, length);
450     }
451 
452     public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException
453     {
454         _resultSet.updateCharacterStream(columnIndex, x, length);
455     }
456 
457     public void updateObject(int columnIndex, Object x, int scale) throws SQLException
458     {
459         _resultSet.updateObject(columnIndex, x, scale);
460     }
461 
462     public void updateObject(int columnIndex, Object x) throws SQLException
463     {
464         _resultSet.updateObject(columnIndex, x);
465     }
466 
467     public void updateNull(String columnName) throws SQLException
468     {
469         _resultSet.updateNull(columnName);
470     }
471 
472     public void updateBoolean(String columnName, boolean x) throws SQLException
473     {
474         _resultSet.updateBoolean(columnName, x);
475     }
476 
477     public void updateByte(String columnName, byte x) throws SQLException
478     {
479         _resultSet.updateByte(columnName, x);
480     }
481 
482     public void updateShort(String columnName, short x) throws SQLException
483     {
484         _resultSet.updateShort(columnName, x);
485     }
486 
487     public void updateInt(String columnName, int x) throws SQLException
488     {
489         _resultSet.updateInt(columnName, x);
490     }
491 
492     public void updateLong(String columnName, long x) throws SQLException
493     {
494         _resultSet.updateLong(columnName, x);
495     }
496 
497     public void updateFloat(String columnName, float x) throws SQLException
498     {
499         _resultSet.updateFloat(columnName, x);
500     }
501 
502     public void updateDouble(String columnName, double x) throws SQLException
503     {
504         _resultSet.updateDouble(columnName, x);
505     }
506 
507     public void updateBigDecimal(String columnName, BigDecimal x) throws SQLException
508     {
509         _resultSet.updateBigDecimal(columnName, x);
510     }
511 
512     public void updateString(String columnName, String x) throws SQLException
513     {
514         _resultSet.updateString(columnName, x);
515     }
516 
517     public void updateBytes(String columnName, byte x[]) throws SQLException
518     {
519         _resultSet.updateBytes(columnName, x);
520     }
521 
522     public void updateDate(String columnName, Date x) throws SQLException
523     {
524         _resultSet.updateDate(columnName, x);
525     }
526 
527     public void updateTime(String columnName, Time x) throws SQLException
528     {
529         _resultSet.updateTime(columnName, x);
530     }
531 
532     public void updateTimestamp(String columnName, Timestamp x) throws SQLException
533     {
534         _resultSet.updateTimestamp(columnName, x);
535     }
536 
537     public void updateAsciiStream(String columnName, InputStream x, int length) throws SQLException
538     {
539         _resultSet.updateAsciiStream(columnName, x, length);
540     }
541 
542     public void updateBinaryStream(String columnName, InputStream x, int length) throws SQLException
543     {
544         _resultSet.updateBinaryStream(columnName, x, length);
545     }
546 
547     public void updateCharacterStream(String columnName, Reader reader, int length) throws SQLException
548     {
549         _resultSet.updateCharacterStream(columnName, reader, length);
550     }
551 
552     public void updateObject(String columnName, Object x, int scale) throws SQLException
553     {
554         _resultSet.updateObject(columnName, x, scale);
555     }
556 
557     public void updateObject(String columnName, Object x) throws SQLException
558     {
559         _resultSet.updateObject(columnName, x);
560     }
561 
562     public void insertRow() throws SQLException
563     {
564         _resultSet.insertRow();
565     }
566 
567     public void updateRow() throws SQLException
568     {
569         _resultSet.updateRow();
570     }
571 
572     public void deleteRow() throws SQLException
573     {
574         _resultSet.deleteRow();
575     }
576 
577     public void refreshRow() throws SQLException
578     {
579         _resultSet.refreshRow();
580     }
581 
582     public void cancelRowUpdates() throws SQLException
583     {
584         _resultSet.cancelRowUpdates();
585     }
586 
587     public void moveToInsertRow() throws SQLException
588     {
589         _resultSet.moveToInsertRow();
590     }
591 
592     public void moveToCurrentRow() throws SQLException
593     {
594         _resultSet.moveToCurrentRow();
595     }
596 
597     public Statement getStatement() throws SQLException
598     {
599         return _statement;
600     }
601 
602     public Object getObject(int i, Map map) throws SQLException
603     {
604         return _columns.getColumn(i).getObject(map);
605     }
606 
607     public Ref getRef(int i) throws SQLException
608     {
609         return _columns.getColumn(i).getRef();
610     }
611 
612     public Blob getBlob(int i) throws SQLException
613     {
614         return _columns.getColumn(i).getBlob();
615     }
616 
617     public Clob getClob(int i) throws SQLException
618     {
619         return _columns.getColumn(i).getClob();
620     }
621 
622     public Array getArray(int i) throws SQLException
623     {
624         return _columns.getColumn(i).getArray();
625     }
626 
627     public Object getObject(String colName, Map map) throws SQLException
628     {
629         return _columns.getColumn(colName).getObject(map);
630     }
631 
632     public Ref getRef(String colName) throws SQLException
633     {
634         return _columns.getColumn(colName).getRef();
635     }
636 
637     public Blob getBlob(String colName) throws SQLException
638     {
639         return _columns.getColumn(colName).getBlob();
640     }
641 
642     public Clob getClob(String colName) throws SQLException
643     {
644         return _columns.getColumn(colName).getClob();
645     }
646 
647     public Array getArray(String colName) throws SQLException
648     {
649         return _columns.getColumn(colName).getArray();
650     }
651 
652     public Date getDate(int columnIndex, Calendar cal) throws SQLException
653     {
654         return _columns.getColumn(columnIndex).getDate(cal);
655     }
656 
657     public Date getDate(String columnName, Calendar cal) throws SQLException
658     {
659         return _columns.getColumn(columnName).getDate(cal);
660     }
661 
662     public Time getTime(int columnIndex, Calendar cal) throws SQLException
663     {
664         return _columns.getColumn(columnIndex).getTime(cal);
665     }
666 
667     public Time getTime(String columnName, Calendar cal) throws SQLException
668     {
669         return _columns.getColumn(columnName).getTime(cal);
670     }
671 
672     public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException
673     {
674         return _columns.getColumn(columnIndex).getTimestamp(cal);
675     }
676 
677     public Timestamp getTimestamp(String columnName, Calendar cal) throws SQLException
678     {
679         return _columns.getColumn(columnName).getTimestamp(cal);
680     }
681 
682     public URL getURL(int columnIndex) throws SQLException
683     {
684         return _columns.getColumn(columnIndex).getURL();
685     }
686 
687     public URL getURL(String columnName) throws SQLException
688     {
689         return _columns.getColumn(columnName).getURL();
690     }
691 
692     public void updateRef(int columnIndex, Ref x) throws SQLException
693     {
694         _resultSet.updateRef(columnIndex, x);
695     }
696 
697     public void updateRef(String columnName, Ref x) throws SQLException
698     {
699         _resultSet.updateRef(columnName, x);
700     }
701 
702     public void updateBlob(int columnIndex, Blob x) throws SQLException
703     {
704         _resultSet.updateBlob(columnIndex, x);
705     }
706 
707     public void updateBlob(String columnName, Blob x) throws SQLException
708     {
709         _resultSet.updateBlob(columnName, x);
710     }
711 
712     public void updateClob(int columnIndex, Clob x) throws SQLException
713     {
714         _resultSet.updateClob(columnIndex, x);
715     }
716 
717     public void updateClob(String columnName, Clob x) throws SQLException
718     {
719         _resultSet.updateClob(columnName, x);
720     }
721 
722     public void updateArray(int columnIndex, Array x) throws SQLException
723     {
724         _resultSet.updateArray(columnIndex, x);
725     }
726 
727     public void updateArray(String columnName, Array x) throws SQLException
728     {
729         _resultSet.updateArray(columnName, x);
730     }
731 }