001    /**
002     * Copyright 2007-2008 Arthur Blake
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     *    http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package net.sf.log4jdbc;
017    
018    import java.io.InputStream;
019    import java.io.Reader;
020    import java.math.BigDecimal;
021    import java.net.URL;
022    import java.sql.Array;
023    import java.sql.Blob;
024    import java.sql.Clob;
025    import java.sql.Date;
026    import java.sql.NClob;
027    import java.sql.Ref;
028    import java.sql.RowId;
029    import java.sql.ResultSet;
030    import java.sql.ResultSetMetaData;
031    import java.sql.SQLException;
032    import java.sql.SQLWarning;
033    import java.sql.SQLXML;
034    import java.sql.Statement;
035    import java.sql.Time;
036    import java.sql.Timestamp;
037    import java.util.Calendar;
038    import java.util.Map;
039    
040    /**
041     * Wraps a ResultSet and reports method calls, returns and exceptions.
042     *
043     * JDBC 4 version.
044     *
045     * @author Arthur Blake
046     */
047    public class ResultSetSpy implements ResultSet, Spy
048    {
049      private final SpyLogDelegator log;
050    
051      /**
052       * Report an exception to be logged.
053       *
054       * @param methodCall description of method call and arguments passed to it that generated the exception.
055       * @param exception exception that was generated
056       */
057      protected void reportException(String methodCall, SQLException exception)
058      {
059        log.exceptionOccured(this, methodCall, exception, null, -1L);
060      }
061    
062      /**
063       * Report (for logging) that a method returned.  All the other reportReturn methods are conveniance methods that call
064       * this method.
065       *
066       * @param methodCall description of method call and arguments passed to it that returned.
067       * @param msg description of what the return value that was returned.  may be an empty String for void return types.
068       */
069      protected void reportAllReturns(String methodCall, String msg)
070      {
071        log.methodReturned(this, methodCall, msg);
072      }
073    
074      private ResultSet realResultSet;
075      private StatementSpy parent;
076    
077      /**
078       * Create a new ResultSetSpy that wraps another ResultSet object, that logs all method calls, expceptions, etc.
079       *
080       * @param parent Statement that generated this ResultSet.
081       * @param realResultSet real underlying ResultSet that is being wrapped.
082       */
083      public ResultSetSpy(StatementSpy parent, ResultSet realResultSet)
084      {
085        if (realResultSet == null)
086        {
087          throw new IllegalArgumentException("Must provide a non null real ResultSet");
088        }
089        this.realResultSet = realResultSet;
090        this.parent = parent;
091        log = SpyLogFactory.getSpyLogDelegator();
092        reportReturn("new ResultSet");
093      }
094    
095      /**
096       * Description for ResultSet class type.
097       */
098      public static final String classTypeDescription = "ResultSet";
099    
100      public String getClassType()
101      {
102        return classTypeDescription;
103      }
104    
105      public Integer getConnectionNumber()
106      {
107        return parent.getConnectionNumber();
108      }
109    
110      /**
111       * Conveniance method to report (for logging) that a method returned a boolean value.
112       *
113       * @param methodCall description of method call and arguments passed to it that returned.
114       * @param value boolean return value.
115       * @return the boolean return value as passed in.
116       */
117      protected boolean reportReturn(String methodCall, boolean value)
118      {
119        reportAllReturns(methodCall, "" + value);
120        return value;
121      }
122    
123      /**
124       * Conveniance method to report (for logging) that a method returned a byte value.
125       *
126       * @param methodCall description of method call and arguments passed to it that returned.
127       * @param value byte return value.
128       * @return the byte return value as passed in.
129       */
130      protected byte reportReturn(String methodCall, byte value)
131      {
132        reportAllReturns(methodCall, "" + value);
133        return value;
134      }
135    
136      /**
137       * Conveniance method to report (for logging) that a method returned a int value.
138       *
139       * @param methodCall description of method call and arguments passed to it that returned.
140       * @param value int return value.
141       * @return the int return value as passed in.
142       */
143      protected int reportReturn(String methodCall, int value)
144      {
145        reportAllReturns(methodCall, "" + value);
146        return value;
147      }
148    
149      /**
150       * Conveniance method to report (for logging) that a method returned a double value.
151       *
152       * @param methodCall description of method call and arguments passed to it that returned.
153       * @param value double return value.
154       * @return the double return value as passed in.
155       */
156      protected double reportReturn(String methodCall, double value)
157      {
158        reportAllReturns(methodCall, "" + value);
159        return value;
160      }
161    
162      /**
163       * Conveniance method to report (for logging) that a method returned a short value.
164       *
165       * @param methodCall description of method call and arguments passed to it that returned.
166       * @param value short return value.
167       * @return the short return value as passed in.
168       */
169      protected short reportReturn(String methodCall, short value)
170      {
171        reportAllReturns(methodCall, "" + value);
172        return value;
173      }
174    
175      /**
176       * Conveniance method to report (for logging) that a method returned a long value.
177       *
178       * @param methodCall description of method call and arguments passed to it that returned.
179       * @param value long return value.
180       * @return the long return value as passed in.
181       */
182      protected long reportReturn(String methodCall, long value)
183      {
184        reportAllReturns(methodCall, "" + value);
185        return value;
186      }
187    
188      /**
189       * Conveniance method to report (for logging) that a method returned a float value.
190       *
191       * @param methodCall description of method call and arguments passed to it that returned.
192       * @param value float return value.
193       * @return the float return value as passed in.
194       */
195      protected float reportReturn(String methodCall, float value)
196      {
197        reportAllReturns(methodCall, "" + value);
198        return value;
199      }
200    
201      /**
202       * Conveniance method to report (for logging) that a method returned an Object.
203       *
204       * @param methodCall description of method call and arguments passed to it that returned.
205       * @param value return Object.
206       * @return the return Object as passed in.
207       */
208      protected Object reportReturn(String methodCall, Object value)
209      {
210        reportAllReturns(methodCall, "" + value);
211        return value;
212      }
213    
214      /**
215       * Conveniance method to report (for logging) that a method returned (void return type).
216       *
217       * @param methodCall description of method call and arguments passed to it that returned.
218       */
219      protected void reportReturn(String methodCall)
220      {
221        reportAllReturns(methodCall, "");
222      }
223    
224      // forwarding methods
225    
226      public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException
227      {
228        String methodCall = "updateAsciiStream(" + columnIndex + ", " + x + ", " + length + ")";
229        try
230        {
231          realResultSet.updateAsciiStream(columnIndex, x, length);
232        }
233        catch (SQLException s)
234        {
235          reportException(methodCall, s);
236          throw s;
237        }
238        reportReturn(methodCall);
239      }
240    
241      public void updateAsciiStream(String columnName, InputStream x, int length) throws SQLException
242      {
243        String methodCall = "updateAsciiStream(" + columnName + ", " + x + ", " + length + ")";
244        try
245        {
246          realResultSet.updateAsciiStream(columnName, x, length);
247        }
248        catch (SQLException s)
249        {
250          reportException(methodCall, s);
251          throw s;
252        }
253        reportReturn(methodCall);
254      }
255    
256      public int getRow() throws SQLException
257      {
258        String methodCall = "getRow()";
259        try
260        {
261          return reportReturn(methodCall, realResultSet.getRow());
262        }
263        catch (SQLException s)
264        {
265          reportException(methodCall, s);
266          throw s;
267        }
268      }
269    
270      public void cancelRowUpdates() throws SQLException
271      {
272        String methodCall = "cancelRowUpdates()";
273        try
274        {
275          realResultSet.cancelRowUpdates();
276        }
277        catch (SQLException s)
278        {
279          reportException(methodCall, s);
280          throw s;
281        }
282        reportReturn(methodCall);
283      }
284    
285      public Time getTime(int columnIndex) throws SQLException
286      {
287        String methodCall = "getTime(" + columnIndex + ")";
288        try
289        {
290          return (Time) reportReturn(methodCall, realResultSet.getTime(columnIndex));
291        }
292        catch (SQLException s)
293        {
294          reportException(methodCall, s);
295          throw s;
296        }
297      }
298    
299      public Time getTime(String columnName) throws SQLException
300      {
301        String methodCall = "getTime(" + columnName + ")";
302        try
303        {
304          return (Time) reportReturn(methodCall, realResultSet.getTime(columnName));
305        }
306        catch (SQLException s)
307        {
308          reportException(methodCall, s);
309          throw s;
310        }
311      }
312    
313      public Time getTime(int columnIndex, Calendar cal) throws SQLException
314      {
315        String methodCall = "getTime(" + columnIndex + ", " + cal + ")";
316        try
317        {
318          return (Time) reportReturn(methodCall, realResultSet.getTime(columnIndex, cal));
319        }
320        catch (SQLException s)
321        {
322          reportException(methodCall, s);
323          throw s;
324        }
325      }
326    
327      public Time getTime(String columnName, Calendar cal) throws SQLException
328      {
329        String methodCall = "getTime(" + columnName + ", " + cal + ")";
330        try
331        {
332          return (Time) reportReturn(methodCall, realResultSet.getTime(columnName, cal));
333        }
334        catch (SQLException s)
335        {
336          reportException(methodCall, s);
337          throw s;
338        }
339      }
340    
341      public boolean absolute(int row) throws SQLException
342      {
343        String methodCall = "absolute(" + row + ")";
344        try
345        {
346          return reportReturn(methodCall, realResultSet.absolute(row));
347        }
348        catch (SQLException s)
349        {
350          reportException(methodCall, s);
351          throw s;
352        }
353      }
354    
355      public Timestamp getTimestamp(int columnIndex) throws SQLException
356      {
357        String methodCall = "getTimestamp(" + columnIndex + ")";
358        try
359        {
360          return (Timestamp) reportReturn(methodCall, realResultSet.getTimestamp(columnIndex));
361        }
362        catch (SQLException s)
363        {
364          reportException(methodCall, s);
365          throw s;
366        }
367      }
368    
369      public Timestamp getTimestamp(String columnName) throws SQLException
370      {
371        String methodCall = "getTimestamp(" + columnName + ")";
372        try
373        {
374          return (Timestamp) reportReturn(methodCall, realResultSet.getTimestamp(columnName));
375        }
376        catch (SQLException s)
377        {
378          reportException(methodCall, s);
379          throw s;
380        }
381    
382      }
383    
384      public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException
385      {
386        String methodCall = "getTimestamp(" + columnIndex + ", " + cal + ")";
387        try
388        {
389          return (Timestamp) reportReturn(methodCall, realResultSet.getTimestamp(columnIndex, cal));
390        }
391        catch (SQLException s)
392        {
393          reportException(methodCall, s);
394          throw s;
395        }
396    
397      }
398    
399      public Timestamp getTimestamp(String columnName, Calendar cal) throws SQLException
400      {
401        String methodCall = "getTimestamp(" + columnName + ", " + cal + ")";
402        try
403        {
404          return (Timestamp) reportReturn(methodCall, realResultSet.getTimestamp(columnName, cal));
405        }
406        catch (SQLException s)
407        {
408          reportException(methodCall, s);
409          throw s;
410        }
411      }
412    
413      public void moveToInsertRow() throws SQLException
414      {
415        String methodCall = "moveToInsertRow()";
416        try
417        {
418          realResultSet.moveToInsertRow();
419        }
420        catch (SQLException s)
421        {
422          reportException(methodCall, s);
423          throw s;
424        }
425        reportReturn(methodCall);
426      }
427    
428      public boolean relative(int rows) throws SQLException
429      {
430        String methodCall = "relative(" + rows + ")";
431        try
432        {
433          return reportReturn(methodCall, realResultSet.relative(rows));
434        }
435        catch (SQLException s)
436        {
437          reportException(methodCall, s);
438          throw s;
439        }
440      }
441    
442      public boolean previous() throws SQLException
443      {
444        String methodCall = "previous()";
445        try
446        {
447          return reportReturn(methodCall, realResultSet.previous());
448        }
449        catch (SQLException s)
450        {
451          reportException(methodCall, s);
452          throw s;
453        }
454      }
455    
456      public void moveToCurrentRow() throws SQLException
457      {
458        String methodCall = "moveToCurrentRow()";
459        try
460        {
461          realResultSet.moveToCurrentRow();
462        }
463        catch (SQLException s)
464        {
465          reportException(methodCall, s);
466          throw s;
467        }
468        reportReturn(methodCall);
469      }
470    
471      public Ref getRef(int i) throws SQLException
472      {
473        String methodCall = "getRef(" + i + ")";
474        try
475        {
476          return (Ref) reportReturn(methodCall, realResultSet.getRef(i));
477        }
478        catch (SQLException s)
479        {
480          reportException(methodCall, s);
481          throw s;
482        }
483      }
484    
485      public void updateRef(int columnIndex, Ref x) throws SQLException
486      {
487        String methodCall = "updateRef(" + columnIndex + ", " + x + ")";
488        try
489        {
490          realResultSet.updateRef(columnIndex, x);
491        }
492        catch (SQLException s)
493        {
494          reportException(methodCall, s);
495          throw s;
496        }
497        reportReturn(methodCall);
498      }
499    
500      public Ref getRef(String colName) throws SQLException
501      {
502        String methodCall = "getRef(" + colName + ")";
503        try
504        {
505          return (Ref) reportReturn(methodCall, realResultSet.getRef(colName));
506        }
507        catch (SQLException s)
508        {
509          reportException(methodCall, s);
510          throw s;
511        }
512      }
513    
514      public void updateRef(String columnName, Ref x) throws SQLException
515      {
516        String methodCall = "updateRef(" + columnName + ", " + x + ")";
517        try
518        {
519          realResultSet.updateRef(columnName, x);
520        }
521        catch (SQLException s)
522        {
523          reportException(methodCall, s);
524          throw s;
525        }
526        reportReturn(methodCall);
527      }
528    
529      public Blob getBlob(int i) throws SQLException
530      {
531        String methodCall = "getBlob(" + i + ")";
532        try
533        {
534          return (Blob) reportReturn(methodCall, realResultSet.getBlob(i));
535        }
536        catch (SQLException s)
537        {
538          reportException(methodCall, s);
539          throw s;
540        }
541      }
542    
543      public void updateBlob(int columnIndex, Blob x) throws SQLException
544      {
545        String methodCall = "updateBlob(" + columnIndex + ", " + x + ")";
546        try
547        {
548          realResultSet.updateBlob(columnIndex, x);
549        }
550        catch (SQLException s)
551        {
552          reportException(methodCall, s);
553          throw s;
554        }
555        reportReturn(methodCall);
556      }
557    
558      public Blob getBlob(String colName) throws SQLException
559      {
560        String methodCall = "getBlob(" + colName + ")";
561        try
562        {
563          return (Blob) reportReturn(methodCall, realResultSet.getBlob(colName));
564        }
565        catch (SQLException s)
566        {
567          reportException(methodCall, s);
568          throw s;
569        }
570      }
571    
572      public void updateBlob(String columnName, Blob x) throws SQLException
573      {
574        String methodCall = "updateBlob(" + columnName + ", " + x + ")";
575        try
576        {
577          realResultSet.updateBlob(columnName, x);
578        }
579        catch (SQLException s)
580        {
581          reportException(methodCall, s);
582          throw s;
583        }
584        reportReturn(methodCall);
585      }
586    
587      public Clob getClob(int i) throws SQLException
588      {
589        String methodCall = "getClob(" + i + ")";
590        try
591        {
592          return (Clob) reportReturn(methodCall, realResultSet.getClob(i));
593        }
594        catch (SQLException s)
595        {
596          reportException(methodCall, s);
597          throw s;
598        }
599      }
600    
601      public void updateClob(int columnIndex, Clob x) throws SQLException
602      {
603        String methodCall = "updateClob(" + columnIndex + ", " + x + ")";
604        try
605        {
606          realResultSet.updateClob(columnIndex, x);
607        }
608        catch (SQLException s)
609        {
610          reportException(methodCall, s);
611          throw s;
612        }
613        reportReturn(methodCall);
614      }
615    
616      public Clob getClob(String colName) throws SQLException
617      {
618        String methodCall = "getClob(" + colName + ")";
619        try
620        {
621          return (Clob) reportReturn(methodCall, realResultSet.getClob(colName));
622        }
623        catch (SQLException s)
624        {
625          reportException(methodCall, s);
626          throw s;
627        }
628      }
629    
630      public void updateClob(String columnName, Clob x) throws SQLException
631      {
632        String methodCall = "updateClob(" + columnName + ", " + x + ")";
633        try
634        {
635          realResultSet.updateClob(columnName, x);
636        }
637        catch (SQLException s)
638        {
639          reportException(methodCall, s);
640          throw s;
641        }
642        reportReturn(methodCall);
643      }
644    
645      public boolean getBoolean(int columnIndex) throws SQLException
646      {
647        String methodCall = "getBoolean(" + columnIndex + ")";
648        try
649        {
650          return reportReturn(methodCall, realResultSet.getBoolean(columnIndex));
651        }
652        catch (SQLException s)
653        {
654          reportException(methodCall, s);
655          throw s;
656        }
657      }
658    
659      public boolean getBoolean(String columnName) throws SQLException
660      {
661        String methodCall = "getBoolean(" + columnName + ")";
662        try
663        {
664          return reportReturn(methodCall, realResultSet.getBoolean(columnName));
665        }
666        catch (SQLException s)
667        {
668          reportException(methodCall, s);
669          throw s;
670        }
671      }
672    
673      public Array getArray(int i) throws SQLException
674      {
675        String methodCall = "getArray(" + i + ")";
676        try
677        {
678          return (Array) reportReturn(methodCall, realResultSet.getArray(i));
679        }
680        catch (SQLException s)
681        {
682          reportException(methodCall, s);
683          throw s;
684        }
685      }
686    
687      public void updateArray(int columnIndex, Array x) throws SQLException
688      {
689        String methodCall = "updateArray(" + columnIndex + ", " + x + ")";
690        try
691        {
692          realResultSet.updateArray(columnIndex, x);
693        }
694        catch (SQLException s)
695        {
696          reportException(methodCall, s);
697          throw s;
698        }
699        reportReturn(methodCall);
700      }
701    
702      public Array getArray(String colName) throws SQLException
703      {
704        String methodCall = "getArray(" + colName + ")";
705        try
706        {
707          return (Array) reportReturn(methodCall, realResultSet.getArray(colName));
708        }
709        catch (SQLException s)
710        {
711          reportException(methodCall, s);
712          throw s;
713        }
714      }
715    
716      public void updateArray(String columnName, Array x) throws SQLException
717      {
718        String methodCall = "updateArray(" + columnName + ", " + x + ")";
719        try
720        {
721          realResultSet.updateArray(columnName, x);
722        }
723        catch (SQLException s)
724        {
725          reportException(methodCall, s);
726          throw s;
727        }
728        reportReturn(methodCall);
729      }
730    
731      public RowId getRowId(int columnIndex) throws SQLException {
732        String methodCall = "getRowId(" + columnIndex + ")";
733        try
734        {
735          return (RowId) reportReturn(methodCall, realResultSet.getRowId(columnIndex));
736        }
737        catch (SQLException s)
738        {
739          reportException(methodCall, s);
740          throw s;
741        }
742      }
743    
744      public RowId getRowId(String columnLabel) throws SQLException {
745        String methodCall = "getRowId(" + columnLabel + ")";
746        try
747        {
748          return (RowId) reportReturn(methodCall, realResultSet.getRowId(columnLabel));
749        }
750        catch (SQLException s)
751        {
752          reportException(methodCall, s);
753          throw s;
754        }
755      }
756    
757      public void updateRowId(int columnIndex, RowId x) throws SQLException {
758        String methodCall = "updateRowId(" + columnIndex + ", " + x + ")";
759        try
760        {
761          realResultSet.updateRowId(columnIndex, x);
762        }
763        catch (SQLException s)
764        {
765          reportException(methodCall, s);
766          throw s;
767        }
768        reportReturn(methodCall);
769      }
770    
771      public void updateRowId(String columnLabel, RowId x) throws SQLException {
772        String methodCall = "updateRowId(" + columnLabel + ", " + x + ")";
773        try
774        {
775          realResultSet.updateRowId(columnLabel, x);
776        }
777        catch (SQLException s)
778        {
779          reportException(methodCall, s);
780          throw s;
781        }
782        reportReturn(methodCall);
783      }
784    
785      public int getHoldability() throws SQLException {
786        String methodCall = "getHoldability()";
787        try
788        {
789          return reportReturn(methodCall, realResultSet.getHoldability());
790        }
791        catch (SQLException s)
792        {
793          reportException(methodCall, s);
794          throw s;
795        }
796      }
797    
798      public boolean isClosed() throws SQLException {
799        String methodCall = "isClosed()";
800        try
801        {
802          return reportReturn(methodCall, realResultSet.isClosed());
803        }
804        catch (SQLException s)
805        {
806          reportException(methodCall, s);
807          throw s;
808        }
809      }
810    
811      public void updateNString(int columnIndex, String nString) throws SQLException {
812        String methodCall = "updateNString(" + columnIndex + ", " + nString + ")";
813        try
814        {
815          realResultSet.updateNString(columnIndex, nString);
816        }
817        catch (SQLException s)
818        {
819          reportException(methodCall, s);
820          throw s;
821        }
822        reportReturn(methodCall);
823      }
824    
825      public void updateNString(String columnLabel, String nString) throws SQLException {
826        String methodCall = "updateNString(" + columnLabel + ", " + nString + ")";
827        try
828        {
829          realResultSet.updateNString(columnLabel, nString);
830        }
831        catch (SQLException s)
832        {
833          reportException(methodCall, s);
834          throw s;
835        }
836        reportReturn(methodCall);
837      }
838    
839      public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
840        String methodCall = "updateNClob(" + columnIndex + ", " + nClob + ")";
841        try
842        {
843          realResultSet.updateNClob(columnIndex, nClob);
844        }
845        catch (SQLException s)
846        {
847          reportException(methodCall, s);
848          throw s;
849        }
850        reportReturn(methodCall);
851      }
852    
853      public void updateNClob(String columnLabel, NClob nClob) throws SQLException {
854        String methodCall = "updateNClob(" + columnLabel + ", " + nClob + ")";
855        try
856        {
857          realResultSet.updateNClob(columnLabel, nClob);
858        }
859        catch (SQLException s)
860        {
861          reportException(methodCall, s);
862          throw s;
863        }
864        reportReturn(methodCall);
865      }
866    
867      public NClob getNClob(int columnIndex) throws SQLException {
868        String methodCall = "getNClob(" + columnIndex + ")";
869        try
870        {
871          return (NClob) reportReturn(methodCall, realResultSet.getNClob(columnIndex));
872        }
873        catch (SQLException s)
874        {
875          reportException(methodCall, s);
876          throw s;
877        }
878      }
879    
880      public NClob getNClob(String columnLabel) throws SQLException {
881        String methodCall = "getNClob(" + columnLabel + ")";
882        try
883        {
884          return (NClob) reportReturn(methodCall, realResultSet.getNClob(columnLabel));
885        }
886        catch (SQLException s)
887        {
888          reportException(methodCall, s);
889          throw s;
890        }
891      }
892    
893      public SQLXML getSQLXML(int columnIndex) throws SQLException {
894        String methodCall = "getSQLXML(" + columnIndex + ")";
895        try
896        {
897          return (SQLXML) reportReturn(methodCall, realResultSet.getSQLXML(columnIndex));
898        }
899        catch (SQLException s)
900        {
901          reportException(methodCall, s);
902          throw s;
903        }
904      }
905    
906      public SQLXML getSQLXML(String columnLabel) throws SQLException {
907        String methodCall = "getSQLXML(" + columnLabel + ")";
908        try
909        {
910          return (SQLXML) reportReturn(methodCall, realResultSet.getSQLXML(columnLabel));
911        }
912        catch (SQLException s)
913        {
914          reportException(methodCall, s);
915          throw s;
916        }
917      }
918    
919      public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException {
920        String methodCall = "updateSQLXML(" + columnIndex + ", " + xmlObject + ")";
921        try
922        {
923          realResultSet.updateSQLXML(columnIndex, xmlObject);
924        }
925        catch (SQLException s)
926        {
927          reportException(methodCall, s);
928          throw s;
929        }
930        reportReturn(methodCall);
931      }
932    
933      public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
934        String methodCall = "updateSQLXML(" + columnLabel + ", " + xmlObject + ")";
935        try
936        {
937          realResultSet.updateSQLXML(columnLabel, xmlObject);
938        }
939        catch (SQLException s)
940        {
941          reportException(methodCall, s);
942          throw s;
943        }
944        reportReturn(methodCall);
945      }
946    
947      public String getNString(int columnIndex) throws SQLException {
948        String methodCall = "getNString(" + columnIndex + ")";
949        try
950        {
951          return (String) reportReturn(methodCall, realResultSet.getNString(columnIndex));
952        }
953        catch (SQLException s)
954        {
955          reportException(methodCall, s);
956          throw s;
957        }
958      }
959    
960      public String getNString(String columnLabel) throws SQLException {
961        String methodCall = "getNString(" + columnLabel + ")";
962        try
963        {
964          return (String) reportReturn(methodCall, realResultSet.getNString(columnLabel));
965        }
966        catch (SQLException s)
967        {
968          reportException(methodCall, s);
969          throw s;
970        }
971      }
972    
973      public Reader getNCharacterStream(int columnIndex) throws SQLException {
974        String methodCall = "getNCharacterStream(" + columnIndex + ")";
975        try
976        {
977          return (Reader) reportReturn(methodCall, realResultSet.getNCharacterStream(columnIndex));
978        }
979        catch (SQLException s)
980        {
981          reportException(methodCall, s);
982          throw s;
983        }
984      }
985    
986      public Reader getNCharacterStream(String columnLabel) throws SQLException {
987        String methodCall = "getNCharacterStream(" + columnLabel + ")";
988        try
989        {
990          return (Reader) reportReturn(methodCall, realResultSet.getNCharacterStream(columnLabel));
991        }
992        catch (SQLException s)
993        {
994          reportException(methodCall, s);
995          throw s;
996        }
997      }
998    
999      public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
1000        String methodCall = "updateNCharacterStream(" + columnIndex + ", " + x + ", " + length + ")";
1001        try
1002        {
1003          realResultSet.updateNCharacterStream(columnIndex, x, length);
1004        }
1005        catch (SQLException s)
1006        {
1007          reportException(methodCall, s);
1008          throw s;
1009        }
1010        reportReturn(methodCall);
1011      }
1012    
1013      public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
1014        String methodCall = "updateNCharacterStream(" + columnLabel + ", " + reader + ", " + length + ")";
1015        try
1016        {
1017          realResultSet.updateNCharacterStream(columnLabel, reader, length);
1018        }
1019        catch (SQLException s)
1020        {
1021          reportException(methodCall, s);
1022          throw s;
1023        }
1024        reportReturn(methodCall);
1025      }
1026    
1027      public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException {
1028        String methodCall = "updateAsciiStream(" + columnIndex + ", " + x + ", " + length + ")";
1029        try
1030        {
1031          realResultSet.updateAsciiStream(columnIndex, x, length);
1032        }
1033        catch (SQLException s)
1034        {
1035          reportException(methodCall, s);
1036          throw s;
1037        }
1038        reportReturn(methodCall);
1039      }
1040    
1041      public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException {
1042        String methodCall = "updateBinaryStream(" + columnIndex + ", " + x + ", " + length + ")";
1043        try
1044        {
1045          realResultSet.updateBinaryStream(columnIndex, x, length);
1046        }
1047        catch (SQLException s)
1048        {
1049          reportException(methodCall, s);
1050          throw s;
1051        }
1052        reportReturn(methodCall);
1053      }
1054    
1055      public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
1056        String methodCall = "updateCharacterStream(" + columnIndex + ", " + x + ", " + length + ")";
1057        try
1058        {
1059          realResultSet.updateCharacterStream(columnIndex, x, length);
1060        }
1061        catch (SQLException s)
1062        {
1063          reportException(methodCall, s);
1064          throw s;
1065        }
1066        reportReturn(methodCall);
1067      }
1068    
1069      public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException {
1070        String methodCall = "updateAsciiStream(" + columnLabel + ", " + x + ", " + length + ")";
1071        try
1072        {
1073          realResultSet.updateAsciiStream(columnLabel, x, length);
1074        }
1075        catch (SQLException s)
1076        {
1077          reportException(methodCall, s);
1078          throw s;
1079        }
1080        reportReturn(methodCall);
1081      }
1082    
1083      public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException {
1084        String methodCall = "updateBinaryStream(" + columnLabel + ", " + x + ", " + length + ")";
1085        try
1086        {
1087          realResultSet.updateBinaryStream(columnLabel, x, length);
1088        }
1089        catch (SQLException s)
1090        {
1091          reportException(methodCall, s);
1092          throw s;
1093        }
1094        reportReturn(methodCall);
1095      }
1096    
1097      public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
1098        String methodCall = "updateCharacterStream(" + columnLabel + ", " + reader + ", " + length + ")";
1099        try
1100        {
1101          realResultSet.updateCharacterStream(columnLabel, reader, length);
1102        }
1103        catch (SQLException s)
1104        {
1105          reportException(methodCall, s);
1106          throw s;
1107        }
1108        reportReturn(methodCall);
1109      }
1110    
1111      public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException {
1112        String methodCall = "updateBlob(" + columnIndex + ", " + inputStream + ", " + length + ")";
1113        try
1114        {
1115          realResultSet.updateBlob(columnIndex, inputStream, length);
1116        }
1117        catch (SQLException s)
1118        {
1119          reportException(methodCall, s);
1120          throw s;
1121        }
1122        reportReturn(methodCall);
1123      }
1124    
1125      public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException {
1126        String methodCall = "updateBlob(" + columnLabel + ", " + inputStream + ", " + length + ")";
1127        try
1128        {
1129          realResultSet.updateBlob(columnLabel, inputStream, length);
1130        }
1131        catch (SQLException s)
1132        {
1133          reportException(methodCall, s);
1134          throw s;
1135        }
1136        reportReturn(methodCall);
1137      }
1138    
1139      public void updateClob(int columnIndex, Reader reader, long length) throws SQLException {
1140        String methodCall = "updateClob(" + columnIndex + ", " + reader + ", " + length + ")";
1141        try
1142        {
1143          realResultSet.updateClob(columnIndex, reader, length);
1144        }
1145        catch (SQLException s)
1146        {
1147          reportException(methodCall, s);
1148          throw s;
1149        }
1150        reportReturn(methodCall);
1151      }
1152    
1153      public void updateClob(String columnLabel, Reader reader, long length) throws SQLException {
1154        String methodCall = "updateClob(" + columnLabel + ", " + reader + ", " + length + ")";
1155        try
1156        {
1157          realResultSet.updateClob(columnLabel, reader, length);
1158        }
1159        catch (SQLException s)
1160        {
1161          reportException(methodCall, s);
1162          throw s;
1163        }
1164        reportReturn(methodCall);
1165      }
1166    
1167      public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException {
1168        String methodCall = "updateNClob(" + columnIndex + ", " + reader + ", " + length + ")";
1169        try
1170        {
1171          realResultSet.updateNClob(columnIndex, reader, length);
1172        }
1173        catch (SQLException s)
1174        {
1175          reportException(methodCall, s);
1176          throw s;
1177        }
1178        reportReturn(methodCall);
1179      }
1180    
1181      public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException {
1182        String methodCall = "updateNClob(" + columnLabel + ", " + reader + ", " + length + ")";
1183        try
1184        {
1185          realResultSet.updateNClob(columnLabel, reader, length);
1186        }
1187        catch (SQLException s)
1188        {
1189          reportException(methodCall, s);
1190          throw s;
1191        }
1192        reportReturn(methodCall);
1193      }
1194    
1195      public void updateNCharacterStream(int columnIndex, Reader reader) throws SQLException {
1196        String methodCall = "updateNCharacterStream(" + columnIndex + ", " + reader + ")";
1197        try
1198        {
1199          realResultSet.updateNCharacterStream(columnIndex, reader);
1200        }
1201        catch (SQLException s)
1202        {
1203          reportException(methodCall, s);
1204          throw s;
1205        }
1206        reportReturn(methodCall);
1207      }
1208    
1209      public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException {
1210        String methodCall = "updateNCharacterStream(" + columnLabel + ", " + reader + ")";
1211        try
1212        {
1213          realResultSet.updateNCharacterStream(columnLabel, reader);
1214        }
1215        catch (SQLException s)
1216        {
1217          reportException(methodCall, s);
1218          throw s;
1219        }
1220        reportReturn(methodCall);
1221      }
1222    
1223      public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException {
1224        String methodCall = "updateAsciiStream(" + columnIndex + ", " + x + ")";
1225        try
1226        {
1227          realResultSet.updateAsciiStream(columnIndex, x);
1228        }
1229        catch (SQLException s)
1230        {
1231          reportException(methodCall, s);
1232          throw s;
1233        }
1234        reportReturn(methodCall);
1235      }
1236    
1237      public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException {
1238        String methodCall = "updateBinaryStream(" + columnIndex + ", " + x + ")";
1239        try
1240        {
1241          realResultSet.updateBinaryStream(columnIndex, x);
1242        }
1243        catch (SQLException s)
1244        {
1245          reportException(methodCall, s);
1246          throw s;
1247        }
1248        reportReturn(methodCall);
1249      }
1250    
1251      public void updateCharacterStream(int columnIndex, Reader x) throws SQLException {
1252        String methodCall = "updateCharacterStream(" + columnIndex + ", " + x + ")";
1253        try
1254        {
1255          realResultSet.updateCharacterStream(columnIndex, x);
1256        }
1257        catch (SQLException s)
1258        {
1259          reportException(methodCall, s);
1260          throw s;
1261        }
1262        reportReturn(methodCall);
1263      }
1264    
1265      public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException {
1266        String methodCall = "updateAsciiStream(" + columnLabel + ", " + x + ")";
1267        try
1268        {
1269          realResultSet.updateAsciiStream(columnLabel, x);
1270        }
1271        catch (SQLException s)
1272        {
1273          reportException(methodCall, s);
1274          throw s;
1275        }
1276        reportReturn(methodCall);
1277      }
1278    
1279      public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException {
1280        String methodCall = "updateBinaryStream(" + columnLabel + ", " + x + ")";
1281        try
1282        {
1283          realResultSet.updateBinaryStream(columnLabel, x);
1284        }
1285        catch (SQLException s)
1286        {
1287          reportException(methodCall, s);
1288          throw s;
1289        }
1290        reportReturn(methodCall);
1291      }
1292    
1293      public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException {
1294        String methodCall = "updateCharacterStream(" + columnLabel + ", " + reader + ")";
1295        try
1296        {
1297          realResultSet.updateCharacterStream(columnLabel, reader);
1298        }
1299        catch (SQLException s)
1300        {
1301          reportException(methodCall, s);
1302          throw s;
1303        }
1304        reportReturn(methodCall);
1305      }
1306    
1307      public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException {
1308        String methodCall = "updateBlob(" + columnIndex + ", " + inputStream + ")";
1309        try
1310        {
1311          realResultSet.updateBlob(columnIndex, inputStream);
1312        }
1313        catch (SQLException s)
1314        {
1315          reportException(methodCall, s);
1316          throw s;
1317        }
1318        reportReturn(methodCall);
1319      }
1320    
1321      public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException {
1322        String methodCall = "updateBlob(" + columnLabel + ", " + inputStream + ")";
1323        try
1324        {
1325          realResultSet.updateBlob(columnLabel, inputStream);
1326        }
1327        catch (SQLException s)
1328        {
1329          reportException(methodCall, s);
1330          throw s;
1331        }
1332        reportReturn(methodCall);
1333      }
1334    
1335      public void updateClob(int columnIndex, Reader reader) throws SQLException {
1336        String methodCall = "updateClob(" + columnIndex + ", " + reader + ")";
1337        try
1338        {
1339          realResultSet.updateClob(columnIndex, reader);
1340        }
1341        catch (SQLException s)
1342        {
1343          reportException(methodCall, s);
1344          throw s;
1345        }
1346        reportReturn(methodCall);
1347      }
1348    
1349      public void updateClob(String columnLabel, Reader reader) throws SQLException {
1350        String methodCall = "updateClob(" + columnLabel + ", " + reader + ")";
1351        try
1352        {
1353          realResultSet.updateClob(columnLabel, reader);
1354        }
1355        catch (SQLException s)
1356        {
1357          reportException(methodCall, s);
1358          throw s;
1359        }
1360        reportReturn(methodCall);
1361      }
1362    
1363      public void updateNClob(int columnIndex, Reader reader) throws SQLException {
1364        String methodCall = "updateNClob(" + columnIndex + ", " + reader + ")";
1365        try
1366        {
1367          realResultSet.updateNClob(columnIndex, reader);
1368        }
1369        catch (SQLException s)
1370        {
1371          reportException(methodCall, s);
1372          throw s;
1373        }
1374        reportReturn(methodCall);
1375      }
1376    
1377      public void updateNClob(String columnLabel, Reader reader) throws SQLException {
1378        String methodCall = "updateNClob(" + columnLabel + ", " + reader + ")";
1379        try
1380        {
1381          realResultSet.updateNClob(columnLabel, reader);
1382        }
1383        catch (SQLException s)
1384        {
1385          reportException(methodCall, s);
1386          throw s;
1387        }
1388        reportReturn(methodCall);
1389      }
1390    
1391      public boolean isBeforeFirst() throws SQLException
1392      {
1393        String methodCall = "isBeforeFirst()";
1394        try
1395        {
1396          return reportReturn(methodCall, realResultSet.isBeforeFirst());
1397        }
1398        catch (SQLException s)
1399        {
1400          reportException(methodCall, s);
1401          throw s;
1402        }
1403      }
1404    
1405      public short getShort(int columnIndex) throws SQLException
1406      {
1407        String methodCall = "getShort(" + columnIndex + ")";
1408        try
1409        {
1410          return reportReturn(methodCall, realResultSet.getShort(columnIndex));
1411        }
1412        catch (SQLException s)
1413        {
1414          reportException(methodCall, s);
1415          throw s;
1416        }
1417      }
1418    
1419      public short getShort(String columnName) throws SQLException
1420      {
1421        String methodCall = "getShort(" + columnName + ")";
1422        try
1423        {
1424          return reportReturn(methodCall, realResultSet.getShort(columnName));
1425        }
1426        catch (SQLException s)
1427        {
1428          reportException(methodCall, s);
1429          throw s;
1430        }
1431      }
1432    
1433      public int getInt(int columnIndex) throws SQLException
1434      {
1435        String methodCall = "getInt(" + columnIndex + ")";
1436        try
1437        {
1438          return reportReturn(methodCall, realResultSet.getInt(columnIndex));
1439        }
1440        catch (SQLException s)
1441        {
1442          reportException(methodCall, s);
1443          throw s;
1444        }
1445      }
1446    
1447      public int getInt(String columnName) throws SQLException
1448      {
1449        String methodCall = "getInt(" + columnName + ")";
1450        try
1451        {
1452          return reportReturn(methodCall, realResultSet.getInt(columnName));
1453        }
1454        catch (SQLException s)
1455        {
1456          reportException(methodCall, s);
1457          throw s;
1458        }
1459      }
1460    
1461      public void close() throws SQLException
1462      {
1463        String methodCall = "close()";
1464        try
1465        {
1466          realResultSet.close();
1467        }
1468        catch (SQLException s)
1469        {
1470          reportException(methodCall, s);
1471          throw s;
1472        }
1473        reportReturn(methodCall);
1474      }
1475    
1476      public ResultSetMetaData getMetaData() throws SQLException
1477      {
1478        String methodCall = "getMetaData()";
1479        try
1480        {
1481          return (ResultSetMetaData) reportReturn(methodCall, realResultSet.getMetaData());
1482        }
1483        catch (SQLException s)
1484        {
1485          reportException(methodCall, s);
1486          throw s;
1487        }
1488      }
1489    
1490      public int getType() throws SQLException
1491      {
1492        String methodCall = "getType()";
1493        try
1494        {
1495          return reportReturn(methodCall, realResultSet.getType());
1496        }
1497        catch (SQLException s)
1498        {
1499          reportException(methodCall, s);
1500          throw s;
1501        }
1502      }
1503    
1504      public double getDouble(int columnIndex) throws SQLException
1505      {
1506        String methodCall = "getDouble(" + columnIndex + ")";
1507        try
1508        {
1509          return reportReturn(methodCall, realResultSet.getDouble(columnIndex));
1510        }
1511        catch (SQLException s)
1512        {
1513          reportException(methodCall, s);
1514          throw s;
1515        }
1516      }
1517    
1518      public double getDouble(String columnName) throws SQLException
1519      {
1520        String methodCall = "getDouble(" + columnName + ")";
1521        try
1522        {
1523          return reportReturn(methodCall, realResultSet.getDouble(columnName));
1524        }
1525        catch (SQLException s)
1526        {
1527          reportException(methodCall, s);
1528          throw s;
1529        }
1530      }
1531    
1532      public void deleteRow() throws SQLException
1533      {
1534        String methodCall = "deleteRow()";
1535        try
1536        {
1537          realResultSet.deleteRow();
1538        }
1539        catch (SQLException s)
1540        {
1541          reportException(methodCall, s);
1542          throw s;
1543        }
1544        reportReturn(methodCall);
1545      }
1546    
1547      public int getConcurrency() throws SQLException
1548      {
1549        String methodCall = "getConcurrency()";
1550        try
1551        {
1552          return reportReturn(methodCall, realResultSet.getConcurrency());
1553        }
1554        catch (SQLException s)
1555        {
1556          reportException(methodCall, s);
1557          throw s;
1558        }
1559      }
1560    
1561      public boolean rowUpdated() throws SQLException
1562      {