View Javadoc

1   /***
2    * WrappedCallableStatement.java
3    *
4    * This file is part of the creme library.
5    * The creme library intends to ease the development effort of large
6    * applications by providing easy to use support classes.
7    *
8    * Copyright (C) 2002 Denis Bregeon
9    *
10   *
11   * This library is free software; you can redistribute it and/or
12   * modify it under the terms of the GNU Lesser General Public
13   * License as published by the Free Software Foundation; either
14   * version 2.1 of the License, or (at your option) any later version.
15   *
16   * This library is distributed in the hope that it will be useful,
17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19   * Lesser General Public License for more details.
20   *
21   * You should have received a copy of the GNU Lesser General Public
22   * License along with this library; if not, write to the Free Software
23   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24   *
25   * contact information: dbregeon@sourceforge.net
26   */
27  package org.jcreme.sql;
28  
29  import java.math.BigDecimal;
30  import java.net.URL;
31  import java.sql.Array;
32  import java.sql.Blob;
33  import java.sql.CallableStatement;
34  import java.sql.Clob;
35  import java.sql.Date;
36  import java.sql.Ref;
37  import java.sql.SQLException;
38  import java.sql.Time;
39  import java.sql.Timestamp;
40  import java.util.Calendar;
41  import java.util.Map;
42  
43  /***
44   * This class enables to wrap an actual statement to provide a few extra
45   * services: tracing of the queries, handling of some exceptions (rollback, loss
46   * of connection). The ResultSets provided by this class are wrapped around the
47   * actual ResultSet.
48   * 
49   * @author $Author: dbregeon $
50   * @version $Revision: 1.1 $
51   */
52  public class WrappedCallableStatement extends WrappedPreparedStatement
53          implements CallableStatement {
54      /***
55       * Enables to wrap a CallableStatement.
56       * 
57       * @param callableStatement
58       *            the statement to wrap.
59       * @param sql
60       *            the query associated to the CallableStatement.
61       * @throws SQLException
62       *             if the preparedStatement is null.
63       */
64      public WrappedCallableStatement(CallableStatement callableStatement,
65              String sql) throws SQLException {
66          super(callableStatement, sql);
67      }
68  
69      /***
70       * @see CallableStatement#getArray(int)
71       */
72      public Array getArray(int i) throws SQLException {
73          try {
74              return ((CallableStatement) this.realStatement).getArray(i);
75          } catch (SQLException e) {
76              manageException(e);
77              throw generateException(e);
78          }
79      }
80  
81      /***
82       * @see CallableStatement#getBigDecimal(int)
83       */
84      public BigDecimal getBigDecimal(int parameterIndex) throws SQLException {
85          try {
86              return ((CallableStatement) this.realStatement)
87                      .getBigDecimal(parameterIndex);
88          } catch (SQLException e) {
89              manageException(e);
90              throw generateException(e);
91          }
92      }
93  
94      /***
95       * @deprecated
96       * @see CallableStatement#getBigDecimal(int, int)
97       */
98      public BigDecimal getBigDecimal(int parameterIndex, int scale)
99              throws SQLException {
100         try {
101             return ((CallableStatement) this.realStatement).getBigDecimal(
102                     parameterIndex, scale);
103         } catch (SQLException e) {
104             manageException(e);
105             throw generateException(e);
106         }
107     }
108 
109     /***
110      * @see CallableStatement#getBlob(int)
111      */
112     public Blob getBlob(int i) throws SQLException {
113         try {
114             return ((CallableStatement) this.realStatement).getBlob(i);
115         } catch (SQLException e) {
116             manageException(e);
117             throw generateException(e);
118         }
119     }
120 
121     /***
122      * @see CallableStatement#getBoolean(int)
123      */
124     public boolean getBoolean(int parameterIndex) throws SQLException {
125         try {
126             return ((CallableStatement) this.realStatement)
127                     .getBoolean(parameterIndex);
128         } catch (SQLException e) {
129             manageException(e);
130             throw generateException(e);
131         }
132     }
133 
134     /***
135      * @see CallableStatement#getByte(int)
136      */
137     public byte getByte(int parameterIndex) throws SQLException {
138         try {
139             return ((CallableStatement) this.realStatement)
140                     .getByte(parameterIndex);
141         } catch (SQLException e) {
142             manageException(e);
143             throw generateException(e);
144         }
145     }
146 
147     /***
148      * @see CallableStatement#getBytes(int)
149      */
150     public byte[] getBytes(int parameterIndex) throws SQLException {
151         try {
152             return ((CallableStatement) this.realStatement)
153                     .getBytes(parameterIndex);
154         } catch (SQLException e) {
155             manageException(e);
156             throw generateException(e);
157         }
158     }
159 
160     /***
161      * @see CallableStatement#getClob(int)
162      */
163     public Clob getClob(int i) throws SQLException {
164         try {
165             return ((CallableStatement) this.realStatement).getClob(i);
166         } catch (SQLException e) {
167             manageException(e);
168             throw generateException(e);
169         }
170     }
171 
172     /***
173      * @see CallableStatement#getDate(int)
174      */
175     public Date getDate(int parameterIndex) throws SQLException {
176         try {
177             return ((CallableStatement) this.realStatement)
178                     .getDate(parameterIndex);
179         } catch (SQLException e) {
180             manageException(e);
181             throw generateException(e);
182         }
183     }
184 
185     /***
186      * @see CallableStatement#getDate(int, java.util.Calendar)
187      */
188     public Date getDate(int parameterIndex, Calendar cal) throws SQLException {
189         try {
190             return ((CallableStatement) this.realStatement).getDate(
191                     parameterIndex, cal);
192         } catch (SQLException e) {
193             manageException(e);
194             throw generateException(e);
195         }
196     }
197 
198     /***
199      * @see CallableStatement#getDouble(int)
200      */
201     public double getDouble(int parameterIndex) throws SQLException {
202         try {
203             return ((CallableStatement) this.realStatement)
204                     .getDouble(parameterIndex);
205         } catch (SQLException e) {
206             manageException(e);
207             throw generateException(e);
208         }
209     }
210 
211     /***
212      * @see CallableStatement#getFloat(int)
213      */
214     public float getFloat(int parameterIndex) throws SQLException {
215         try {
216             return ((CallableStatement) this.realStatement)
217                     .getFloat(parameterIndex);
218         } catch (SQLException e) {
219             manageException(e);
220             throw generateException(e);
221         }
222     }
223 
224     /***
225      * @see CallableStatement#getInt(int)
226      */
227     public int getInt(int parameterIndex) throws SQLException {
228         try {
229             return ((CallableStatement) this.realStatement)
230                     .getInt(parameterIndex);
231         } catch (SQLException e) {
232             manageException(e);
233             throw generateException(e);
234         }
235     }
236 
237     /***
238      * @see CallableStatement#getLong(int)
239      */
240     public long getLong(int parameterIndex) throws SQLException {
241         try {
242             return ((CallableStatement) this.realStatement)
243                     .getLong(parameterIndex);
244         } catch (SQLException e) {
245             manageException(e);
246             throw generateException(e);
247         }
248     }
249 
250     /***
251      * @see CallableStatement#getObject(int)
252      */
253     public Object getObject(int parameterIndex) throws SQLException {
254         try {
255             return ((CallableStatement) this.realStatement)
256                     .getObject(parameterIndex);
257         } catch (SQLException e) {
258             manageException(e);
259             throw generateException(e);
260         }
261     }
262 
263     /***
264      * @see CallableStatement#getObject(int, java.util.Map)
265      */
266     public Object getObject(int i, Map map) throws SQLException {
267         try {
268             return ((CallableStatement) this.realStatement).getObject(i, map);
269         } catch (SQLException e) {
270             manageException(e);
271             throw generateException(e);
272         }
273     }
274 
275     /***
276      * @see CallableStatement#getRef(int)
277      */
278     public Ref getRef(int i) throws SQLException {
279         try {
280             return ((CallableStatement) this.realStatement).getRef(i);
281         } catch (SQLException e) {
282             manageException(e);
283             throw generateException(e);
284         }
285     }
286 
287     /***
288      * @see CallableStatement#getShort(int)
289      */
290     public short getShort(int parameterIndex) throws SQLException {
291         try {
292             return ((CallableStatement) this.realStatement)
293                     .getShort(parameterIndex);
294         } catch (SQLException e) {
295             manageException(e);
296             throw generateException(e);
297         }
298     }
299 
300     /***
301      * @see CallableStatement#getString(int)
302      */
303     public String getString(int parameterIndex) throws SQLException {
304         try {
305             return ((CallableStatement) this.realStatement)
306                     .getString(parameterIndex);
307         } catch (SQLException e) {
308             manageException(e);
309             throw generateException(e);
310         }
311     }
312 
313     /***
314      * @see CallableStatement#getTime(int)
315      */
316     public Time getTime(int parameterIndex) throws SQLException {
317         try {
318             return ((CallableStatement) this.realStatement)
319                     .getTime(parameterIndex);
320         } catch (SQLException e) {
321             manageException(e);
322             throw generateException(e);
323         }
324     }
325 
326     /***
327      * @see CallableStatement#getTime(int, java.util.Calendar)
328      */
329     public Time getTime(int parameterIndex, Calendar cal) throws SQLException {
330         try {
331             return ((CallableStatement) this.realStatement).getTime(
332                     parameterIndex, cal);
333         } catch (SQLException e) {
334             manageException(e);
335             throw generateException(e);
336         }
337     }
338 
339     /***
340      * @see CallableStatement#getTimestamp(int)
341      */
342     public Timestamp getTimestamp(int parameterIndex) throws SQLException {
343         try {
344             return ((CallableStatement) this.realStatement)
345                     .getTimestamp(parameterIndex);
346         } catch (SQLException e) {
347             manageException(e);
348             throw generateException(e);
349         }
350     }
351 
352     /***
353      * @see CallableStatement#getTimestamp(int, java.util.Calendar)
354      */
355     public Timestamp getTimestamp(int parameterIndex, Calendar cal)
356             throws SQLException {
357         try {
358             return ((CallableStatement) this.realStatement).getTimestamp(
359                     parameterIndex, cal);
360         } catch (SQLException e) {
361             manageException(e);
362             throw generateException(e);
363         }
364     }
365 
366     /***
367      * @see CallableStatement#registerOutParameter(int, int)
368      */
369     public void registerOutParameter(int parameterIndex, int sqlType)
370             throws SQLException {
371         try {
372             ((CallableStatement) this.realStatement).registerOutParameter(
373                     parameterIndex, sqlType);
374         } catch (SQLException e) {
375             manageException(e);
376             throw generateException(e);
377         }
378     }
379 
380     /***
381      * @see CallableStatement#registerOutParameter(int, int, int)
382      */
383     public void registerOutParameter(int parameterIndex, int sqlType, int scale)
384             throws SQLException {
385         try {
386             ((CallableStatement) this.realStatement).registerOutParameter(
387                     parameterIndex, sqlType, scale);
388         } catch (SQLException e) {
389             manageException(e);
390             throw generateException(e);
391         }
392     }
393 
394     /***
395      * @see CallableStatement#registerOutParameter(int, int, java.lang.String)
396      */
397     public void registerOutParameter(int paramIndex, int sqlType,
398             String typeName) throws SQLException {
399         try {
400             ((CallableStatement) this.realStatement).registerOutParameter(
401                     paramIndex, sqlType, typeName);
402         } catch (SQLException e) {
403             manageException(e);
404             throw generateException(e);
405         }
406     }
407 
408     /***
409      * @see CallableStatement#wasNull()
410      */
411     public boolean wasNull() throws SQLException {
412         try {
413             return ((CallableStatement) this.realStatement).wasNull();
414         } catch (SQLException e) {
415             manageException(e);
416             throw generateException(e);
417         }
418     }
419 
420     /***
421      * @see CallableStatement#registerOutParameter(java.lang.String, int)
422      */
423     public void registerOutParameter(String parameterName, int sqlType)
424             throws SQLException {
425         try {
426             ((CallableStatement) this.realStatement).registerOutParameter(
427                     parameterName, sqlType);
428         } catch (SQLException e) {
429             manageException(e);
430             throw generateException(e);
431         }
432     }
433 
434     /***
435      * @see CallableStatement#registerOutParameter(java.lang.String, int, int)
436      */
437     public void registerOutParameter(String parameterName, int sqlType,
438             int scale) throws SQLException {
439         try {
440             ((CallableStatement) this.realStatement).registerOutParameter(
441                     parameterName, sqlType, scale);
442         } catch (SQLException e) {
443             manageException(e);
444             throw generateException(e);
445         }
446     }
447 
448     /***
449      * @see CallableStatement#registerOutParameter(java.lang.String, int,
450      *      java.lang.String)
451      */
452     public void registerOutParameter(String parameterName, int sqlType,
453             String typeName) throws SQLException {
454         try {
455             ((CallableStatement) this.realStatement).registerOutParameter(
456                     parameterName, sqlType, typeName);
457         } catch (SQLException e) {
458             manageException(e);
459             throw generateException(e);
460         }
461     }
462 
463     /***
464      * @see CallableStatement#getURL(int)
465      */
466     public URL getURL(int parameterIndex) throws SQLException {
467         try {
468             return ((CallableStatement) this.realStatement)
469                     .getURL(parameterIndex);
470         } catch (SQLException e) {
471             manageException(e);
472             throw generateException(e);
473         }
474     }
475 
476     /***
477      * @see CallableStatement#getURL(java.lang.String)
478      */
479     public URL getURL(String parameterName) throws SQLException {
480         try {
481             return ((CallableStatement) this.realStatement)
482                     .getURL(parameterName);
483         } catch (SQLException e) {
484             manageException(e);
485             throw generateException(e);
486         }
487     }
488 
489     /***
490      * @see CallableStatement#getArray(java.lang.String)
491      */
492     public Array getArray(String parameterName) throws SQLException {
493         try {
494             return ((CallableStatement) this.realStatement)
495                     .getArray(parameterName);
496         } catch (SQLException e) {
497             manageException(e);
498             throw generateException(e);
499         }
500     }
501 
502     /***
503      * @see CallableStatement#getBigDecimal(java.lang.String)
504      */
505     public BigDecimal getBigDecimal(String parameterName) throws SQLException {
506         try {
507             return ((CallableStatement) this.realStatement)
508                     .getBigDecimal(parameterName);
509         } catch (SQLException e) {
510             manageException(e);
511             throw generateException(e);
512         }
513     }
514 
515     /***
516      * @see CallableStatement#getBlob(java.lang.String)
517      */
518     public Blob getBlob(String parameterName) throws SQLException {
519         try {
520             return ((CallableStatement) this.realStatement)
521                     .getBlob(parameterName);
522         } catch (SQLException e) {
523             manageException(e);
524             throw generateException(e);
525         }
526     }
527 
528     /***
529      * @see CallableStatement#getBoolean(String)
530      */
531     public boolean getBoolean(String parameterName) throws SQLException {
532         try {
533             return ((CallableStatement) this.realStatement)
534                     .getBoolean(parameterName);
535         } catch (SQLException e) {
536             manageException(e);
537             throw generateException(e);
538         }
539     }
540 
541     /***
542      * @see CallableStatement#getByte(String)
543      */
544     public byte getByte(String parameterName) throws SQLException {
545         try {
546             return ((CallableStatement) this.realStatement)
547                     .getByte(parameterName);
548         } catch (SQLException e) {
549             manageException(e);
550             throw generateException(e);
551         }
552     }
553 
554     /***
555      * @see CallableStatement#getBytes(java.lang.String)
556      */
557     public byte[] getBytes(String parameterName) throws SQLException {
558         try {
559             return ((CallableStatement) this.realStatement)
560                     .getBytes(parameterName);
561         } catch (SQLException e) {
562             manageException(e);
563             throw generateException(e);
564         }
565     }
566 
567     /***
568      * @see CallableStatement#getClob(String)
569      */
570     public Clob getClob(String parameterName) throws SQLException {
571         try {
572             return ((CallableStatement) this.realStatement)
573                     .getClob(parameterName);
574         } catch (SQLException e) {
575             manageException(e);
576             throw generateException(e);
577         }
578     }
579 
580     /***
581      * @see CallableStatement#getDate(java.lang.String)
582      */
583     public Date getDate(String parameterName) throws SQLException {
584         try {
585             return ((CallableStatement) this.realStatement)
586                     .getDate(parameterName);
587         } catch (SQLException e) {
588             manageException(e);
589             throw generateException(e);
590         }
591     }
592 
593     /***
594      * @see CallableStatement#getDate(java.lang.String, java.util.Calendar)
595      */
596     public Date getDate(String parameterName, Calendar cal) throws SQLException {
597         try {
598             return ((CallableStatement) this.realStatement).getDate(
599                     parameterName, cal);
600         } catch (SQLException e) {
601             manageException(e);
602             throw generateException(e);
603         }
604     }
605 
606     /***
607      * @see CallableStatement#getDouble(java.lang.String)
608      */
609     public double getDouble(String parameterName) throws SQLException {
610         try {
611             return ((CallableStatement) this.realStatement)
612                     .getDouble(parameterName);
613         } catch (SQLException e) {
614             manageException(e);
615             throw generateException(e);
616         }
617     }
618 
619     /***
620      * @see CallableStatement#getFloat(java.lang.String)
621      */
622     public float getFloat(String parameterName) throws SQLException {
623         try {
624             return ((CallableStatement) this.realStatement)
625                     .getFloat(parameterName);
626         } catch (SQLException e) {
627             manageException(e);
628             throw generateException(e);
629         }
630     }
631 
632     /***
633      * @see CallableStatement#getInt(java.lang.String)
634      */
635     public int getInt(String parameterName) throws SQLException {
636         try {
637             return ((CallableStatement) this.realStatement)
638                     .getInt(parameterName);
639         } catch (SQLException e) {
640             manageException(e);
641             throw generateException(e);
642         }
643     }
644 
645     /***
646      * @see CallableStatement#getLong(java.lang.String)
647      */
648     public long getLong(String parameterName) throws SQLException {
649         try {
650             return ((CallableStatement) this.realStatement)
651                     .getLong(parameterName);
652         } catch (SQLException e) {
653             manageException(e);
654             throw generateException(e);
655         }
656     }
657 
658     /***
659      * @see CallableStatement#getObject(String)
660      */
661     public Object getObject(String parameterName) throws SQLException {
662         try {
663             return ((CallableStatement) this.realStatement)
664                     .getObject(parameterName);
665         } catch (SQLException e) {
666             manageException(e);
667             throw generateException(e);
668         }
669     }
670 
671     /***
672      * @see CallableStatement#getObject(java.lang.String, java.util.Map)
673      */
674     public Object getObject(String parameterName, Map map) throws SQLException {
675         try {
676             return ((CallableStatement) this.realStatement).getObject(
677                     parameterName, map);
678         } catch (SQLException e) {
679             manageException(e);
680             throw generateException(e);
681         }
682     }
683 
684     /***
685      * @see CallableStatement#getRef(java.lang.String)
686      */
687     public Ref getRef(String parameterName) throws SQLException {
688         try {
689             return ((CallableStatement) this.realStatement)
690                     .getRef(parameterName);
691         } catch (SQLException e) {
692             manageException(e);
693             throw generateException(e);
694         }
695     }
696 
697     /***
698      * @see CallableStatement#getShort(java.lang.String)
699      */
700     public short getShort(String parameterName) throws SQLException {
701         try {
702             return ((CallableStatement) this.realStatement)
703                     .getShort(parameterName);
704         } catch (SQLException e) {
705             manageException(e);
706             throw generateException(e);
707         }
708     }
709 
710     /***
711      * @see CallableStatement#getString(java.lang.String)
712      */
713     public String getString(String parameterName) throws SQLException {
714         try {
715             return ((CallableStatement) this.realStatement)
716                     .getString(parameterName);
717         } catch (SQLException e) {
718             manageException(e);
719             throw generateException(e);
720         }
721     }
722 
723     /***
724      * @see CallableStatement#getTime(java.lang.String)
725      */
726     public Time getTime(String parameterName) throws SQLException {
727         try {
728             return ((CallableStatement) this.realStatement)
729                     .getTime(parameterName);
730         } catch (SQLException e) {
731             manageException(e);
732             throw generateException(e);
733         }
734     }
735 
736     /***
737      * @see CallableStatement#getTime(java.lang.String, java.util.Calendar)
738      */
739     public Time getTime(String parameterName, Calendar cal) throws SQLException {
740         try {
741             return ((CallableStatement) this.realStatement).getTime(
742                     parameterName, cal);
743         } catch (SQLException e) {
744             manageException(e);
745             throw generateException(e);
746         }
747     }
748 
749     /***
750      * @see CallableStatement#getTimestamp(java.lang.String)
751      */
752     public Timestamp getTimestamp(String parameterName) throws SQLException {
753         try {
754             return ((CallableStatement) this.realStatement)
755                     .getTimestamp(parameterName);
756         } catch (SQLException e) {
757             manageException(e);
758             throw generateException(e);
759         }
760     }
761 
762     /***
763      * @see CallableStatement#getTimestamp(java.lang.String, java.util.Calendar)
764      */
765     public Timestamp getTimestamp(String parameterName, Calendar cal)
766             throws SQLException {
767         try {
768             return ((CallableStatement) this.realStatement).getTimestamp(
769                     parameterName, cal);
770         } catch (SQLException e) {
771             manageException(e);
772             throw generateException(e);
773         }
774     }
775 
776     /***
777      * @see CallableStatement#setAsciiStream(java.lang.String,
778      *      java.io.InputStream, int)
779      */
780     public void setAsciiStream(String parameterName, java.io.InputStream x,
781             int length) throws SQLException {
782         try {
783             ((CallableStatement) this.realStatement).setAsciiStream(
784                     parameterName, x, length);
785         } catch (SQLException e) {
786             manageException(e);
787             throw generateException(e);
788         }
789     }
790 
791     /***
792      * @see CallableStatement#setBigDecimal(java.lang.String,
793      *      java.math.BigDecimal)
794      */
795     public void setBigDecimal(String parameterName, BigDecimal x)
796             throws SQLException {
797         try {
798             ((CallableStatement) this.realStatement).setBigDecimal(
799                     parameterName, x);
800         } catch (SQLException e) {
801             manageException(e);
802             throw generateException(e);
803         }
804     }
805 
806     /***
807      * @see CallableStatement#setBinaryStream(java.lang.String,
808      *      java.io.InputStream, int)
809      */
810     public void setBinaryStream(String parameterName, java.io.InputStream x,
811             int length) throws SQLException {
812         try {
813             ((CallableStatement) this.realStatement).setBinaryStream(
814                     parameterName, x, length);
815         } catch (SQLException e) {
816             manageException(e);
817             throw generateException(e);
818         }
819     }
820 
821     /***
822      * @see CallableStatement#setBoolean(java.lang.String, boolean)
823      */
824     public void setBoolean(String parameterName, boolean x) throws SQLException {
825         try {
826             ((CallableStatement) this.realStatement).setBoolean(parameterName,
827                     x);
828         } catch (SQLException e) {
829             manageException(e);
830             throw generateException(e);
831         }
832     }
833 
834     /***
835      * @see CallableStatement#setByte(java.lang.String, byte)
836      */
837     public void setByte(String parameterName, byte x) throws SQLException {
838         try {
839             ((CallableStatement) this.realStatement).setByte(parameterName, x);
840         } catch (SQLException e) {
841             manageException(e);
842             throw generateException(e);
843         }
844     }
845 
846     /***
847      * @see CallableStatement#setBytes(java.lang.String, byte[])
848      */
849     public void setBytes(String parameterName, byte[] x) throws SQLException {
850         try {
851             ((CallableStatement) this.realStatement).setBytes(parameterName, x);
852         } catch (SQLException e) {
853             manageException(e);
854             throw generateException(e);
855         }
856     }
857 
858     /***
859      * @see CallableStatement#setCharacterStream(java.lang.String,
860      *      java.io.Reader, int)
861      */
862     public void setCharacterStream(String parameterName, java.io.Reader reader,
863             int length) throws SQLException {
864         try {
865             ((CallableStatement) this.realStatement).setCharacterStream(
866                     parameterName, reader, length);
867         } catch (SQLException e) {
868             manageException(e);
869             throw generateException(e);
870         }
871     }
872 
873     /***
874      * @see CallableStatement#setDate(java.lang.String, java.sql.Date)
875      */
876     public void setDate(String parameterName, java.sql.Date x)
877             throws SQLException {
878         try {
879             ((CallableStatement) this.realStatement).setDate(parameterName, x);
880         } catch (SQLException e) {
881             manageException(e);
882             throw generateException(e);
883         }
884     }
885 
886     /***
887      * @see CallableStatement#setDate(java.lang.String, java.sql.Date,
888      *      java.util.Calendar)
889      */
890     public void setDate(String parameterName, java.sql.Date x, Calendar cal)
891             throws SQLException {
892         try {
893             ((CallableStatement) this.realStatement).setDate(parameterName, x,
894                     cal);
895         } catch (SQLException e) {
896             manageException(e);
897             throw generateException(e);
898         }
899     }
900 
901     /***
902      * @see CallableStatement#setDouble(java.lang.String, double)
903      */
904     public void setDouble(String parameterName, double x) throws SQLException {
905         try {
906             ((CallableStatement) this.realStatement)
907                     .setDouble(parameterName, x);
908         } catch (SQLException e) {
909             manageException(e);
910             throw generateException(e);
911         }
912     }
913 
914     /***
915      * @see CallableStatement#setFloat(java.lang.String, float)
916      */
917     public void setFloat(String parameterName, float x) throws SQLException {
918         try {
919             ((CallableStatement) this.realStatement).setFloat(parameterName, x);
920         } catch (SQLException e) {
921             manageException(e);
922             throw generateException(e);
923         }
924     }
925 
926     /***
927      * @see CallableStatement#setInt(java.lang.String, int)
928      */
929     public void setInt(String parameterName, int x) throws SQLException {
930         try {
931             ((CallableStatement) this.realStatement).setInt(parameterName, x);
932         } catch (SQLException e) {
933             manageException(e);
934             throw generateException(e);
935         }
936     }
937 
938     /***
939      * @see CallableStatement#setLong(java.lang.String, long)
940      */
941     public void setLong(String parameterName, long x) throws SQLException {
942         try {
943             ((CallableStatement) this.realStatement).setLong(parameterName, x);
944         } catch (SQLException e) {
945             manageException(e);
946             throw generateException(e);
947         }
948     }
949 
950     /***
951      * @see CallableStatement#setNull(java.lang.String, int)
952      */
953     public void setNull(String parameterName, int sqlType) throws SQLException {
954         try {
955             ((CallableStatement) this.realStatement).setNull(parameterName,
956                     sqlType);
957         } catch (SQLException e) {
958             manageException(e);
959             throw generateException(e);
960         }
961     }
962 
963     /***
964      * @see CallableStatement#setNull(java.lang.String, int, java.lang.String)
965      */
966     public void setNull(String parameterName, int sqlType, String typeName)
967             throws SQLException {
968         try {
969             ((CallableStatement) this.realStatement).setNull(parameterName,
970                     sqlType, typeName);
971         } catch (SQLException e) {
972             manageException(e);
973             throw generateException(e);
974         }
975     }
976 
977     /***
978      * @see CallableStatement#setObject(java.lang.String, java.lang.Object)
979      */
980     public void setObject(String parameterName, Object x) throws SQLException {
981         try {
982             ((CallableStatement) this.realStatement)
983                     .setObject(parameterName, x);
984         } catch (SQLException e) {
985             manageException(e);
986             throw generateException(e);
987         }
988     }
989 
990     /***
991      * @see CallableStatement#setObject(java.lang.String, java.lang.Object, int)
992      */
993     public void setObject(String parameterName, Object x, int targetSqlType)
994             throws SQLException {
995         try {
996             ((CallableStatement) this.realStatement).setObject(parameterName,
997                     x, targetSqlType);
998         } catch (SQLException e) {
999             manageException(e);
1000             throw generateException(e);
1001         }
1002     }
1003 
1004     /***
1005      * @see CallableStatement#setObject(java.lang.String, java.lang.Object, int,
1006      *      int)
1007      */
1008     public void setObject(String parameterName, Object x, int targetSqlType,
1009             int scale) throws SQLException {
1010         try {
1011             ((CallableStatement) this.realStatement).setObject(parameterName,
1012                     x, targetSqlType, scale);
1013         } catch (SQLException e) {
1014             manageException(e);
1015             throw generateException(e);
1016         }
1017     }
1018 
1019     /***
1020      * @see CallableStatement#setShort(java.lang.String, short)
1021      */
1022     public void setShort(String parameterName, short x) throws SQLException {
1023         try {
1024             ((CallableStatement) this.realStatement).setShort(parameterName, x);
1025         } catch (SQLException e) {
1026             manageException(e);
1027             throw generateException(e);
1028         }
1029     }
1030 
1031     /***
1032      * @see CallableStatement#setString(java.lang.String, java.lang.String)
1033      */
1034     public void setString(String parameterName, String x) throws SQLException {
1035         try {
1036             ((CallableStatement) this.realStatement)
1037                     .setString(parameterName, x);
1038         } catch (SQLException e) {
1039             manageException(e);
1040             throw generateException(e);
1041         }
1042     }
1043 
1044     /***
1045      * @see CallableStatement#setTime(java.lang.String, java.sql.Time)
1046      */
1047     public void setTime(String parameterName, java.sql.Time x)
1048             throws SQLException {
1049         try {
1050             ((CallableStatement) this.realStatement).setTime(parameterName, x);
1051         } catch (SQLException e) {
1052             manageException(e);
1053             throw generateException(e);
1054         }
1055     }
1056 
1057     /***
1058      * @see CallableStatement#setTime(java.lang.String, java.sql.Time,
1059      *      java.util.Calendar)
1060      */
1061     public void setTime(String parameterName, java.sql.Time x, Calendar cal)
1062             throws SQLException {
1063         try {
1064             ((CallableStatement) this.realStatement).setTime(parameterName, x,
1065                     cal);
1066         } catch (SQLException e) {
1067             manageException(e);
1068             throw generateException(e);
1069         }
1070     }
1071 
1072     /***
1073      * @see CallableStatement#setTimestamp(java.lang.String, java.sql.Timestamp)
1074      */
1075     public void setTimestamp(String parameterName, java.sql.Timestamp x)
1076             throws SQLException {
1077         try {
1078             ((CallableStatement) this.realStatement).setTimestamp(
1079                     parameterName, x);
1080         } catch (SQLException e) {
1081             manageException(e);
1082             throw generateException(e);
1083         }
1084     }
1085 
1086     /***
1087      * @see CallableStatement#setTimestamp(java.lang.String, java.sql.Timestamp,
1088      *      java.util.Calendar)
1089      */
1090     public void setTimestamp(String parameterName, java.sql.Timestamp x,
1091             Calendar cal) throws SQLException {
1092         try {
1093             ((CallableStatement) this.realStatement).setTimestamp(
1094                     parameterName, x, cal);
1095         } catch (SQLException e) {
1096             manageException(e);
1097             throw generateException(e);
1098         }
1099     }
1100 
1101     /***
1102      * @see CallableStatement#setURL(java.lang.String, java.net.URL)
1103      */
1104     public void setURL(String parameterName, java.net.URL val)
1105             throws SQLException {
1106         try {
1107             ((CallableStatement) this.realStatement).setURL(parameterName, val);
1108         } catch (SQLException e) {
1109             manageException(e);
1110             throw generateException(e);
1111         }
1112     }
1113 }