001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018package org.apache.commons.dbcp2;
019
020import java.net.URL;
021import java.sql.CallableStatement;
022import java.math.BigDecimal;
023import java.sql.Date;
024import java.sql.Time;
025import java.sql.Timestamp;
026import java.util.Map;
027import java.sql.Ref;
028import java.sql.Blob;
029import java.sql.Clob;
030import java.sql.Array;
031import java.util.Calendar;
032import java.io.InputStream;
033import java.io.Reader;
034import java.sql.SQLException;
035import java.sql.NClob;
036import java.sql.RowId;
037import java.sql.SQLXML;
038
039/**
040 * A base delegating implementation of {@link CallableStatement}.
041 * <p>
042 * All of the methods from the {@link CallableStatement} interface
043 * simply call the corresponding method on the "delegate"
044 * provided in my constructor.
045 * <p>
046 * Extends AbandonedTrace to implement Statement tracking and
047 * logging of code which created the Statement. Tracking the
048 * Statement ensures that the Connection which created it can
049 * close any open Statement's on Connection close.
050 *
051 * @author Glenn L. Nielsen
052 * @author James House
053 * @author Dirk Verbeeck
054 * @version $Revision: 1572242 $ $Date: 2014-02-26 20:34:39 +0000 (Wed, 26 Feb 2014) $
055 * @since 2.0
056 */
057public class DelegatingCallableStatement extends DelegatingPreparedStatement
058        implements CallableStatement {
059
060    /**
061     * Create a wrapper for the Statement which traces this
062     * Statement to the Connection which created it and the
063     * code which created it.
064     *
065     * @param c the {@link DelegatingConnection} that created this statement
066     * @param s the {@link CallableStatement} to delegate all calls to
067     */
068    public DelegatingCallableStatement(DelegatingConnection<?> c,
069                                       CallableStatement s) {
070        super(c, s);
071    }
072
073    @Override
074    public void registerOutParameter(int parameterIndex, int sqlType) throws SQLException
075    { checkOpen(); try { ((CallableStatement)getDelegate()).registerOutParameter( parameterIndex,  sqlType); } catch (SQLException e) { handleException(e); } }
076
077    @Override
078    public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws SQLException
079    { checkOpen(); try { ((CallableStatement)getDelegate()).registerOutParameter( parameterIndex,  sqlType,  scale); } catch (SQLException e) { handleException(e); } }
080
081    @Override
082    public boolean wasNull() throws SQLException
083    { checkOpen(); try { return ((CallableStatement)getDelegate()).wasNull(); } catch (SQLException e) { handleException(e); return false; } }
084
085    @Override
086    public String getString(int parameterIndex) throws SQLException
087    { checkOpen(); try { return ((CallableStatement)getDelegate()).getString( parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
088
089    @Override
090    public boolean getBoolean(int parameterIndex) throws SQLException
091    { checkOpen(); try { return ((CallableStatement)getDelegate()).getBoolean( parameterIndex); } catch (SQLException e) { handleException(e); return false; } }
092
093    @Override
094    public byte getByte(int parameterIndex) throws SQLException
095    { checkOpen(); try { return ((CallableStatement)getDelegate()).getByte( parameterIndex); } catch (SQLException e) { handleException(e); return 0; } }
096
097    @Override
098    public short getShort(int parameterIndex) throws SQLException
099    { checkOpen(); try { return ((CallableStatement)getDelegate()).getShort( parameterIndex); } catch (SQLException e) { handleException(e); return 0; } }
100
101    @Override
102    public int getInt(int parameterIndex) throws SQLException
103    { checkOpen(); try { return ((CallableStatement)getDelegate()).getInt( parameterIndex); } catch (SQLException e) { handleException(e); return 0; } }
104
105    @Override
106    public long getLong(int parameterIndex) throws SQLException
107    { checkOpen(); try { return ((CallableStatement)getDelegate()).getLong( parameterIndex); } catch (SQLException e) { handleException(e); return 0; } }
108
109    @Override
110    public float getFloat(int parameterIndex) throws SQLException
111    { checkOpen(); try { return ((CallableStatement)getDelegate()).getFloat( parameterIndex); } catch (SQLException e) { handleException(e); return 0; } }
112
113    @Override
114    public double getDouble(int parameterIndex) throws SQLException
115    { checkOpen(); try { return ((CallableStatement)getDelegate()).getDouble( parameterIndex); } catch (SQLException e) { handleException(e); return 0; } }
116
117    /** @deprecated */
118    @Override
119    @Deprecated
120    public BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException
121    { checkOpen(); try { return ((CallableStatement)getDelegate()).getBigDecimal( parameterIndex,  scale); } catch (SQLException e) { handleException(e); return null; } }
122
123    @Override
124    public byte[] getBytes(int parameterIndex) throws SQLException
125    { checkOpen(); try { return ((CallableStatement)getDelegate()).getBytes( parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
126
127    @Override
128    public Date getDate(int parameterIndex) throws SQLException
129    { checkOpen(); try { return ((CallableStatement)getDelegate()).getDate( parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
130
131    @Override
132    public Time getTime(int parameterIndex) throws SQLException
133    { checkOpen(); try { return ((CallableStatement)getDelegate()).getTime( parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
134
135    @Override
136    public Timestamp getTimestamp(int parameterIndex) throws SQLException
137    { checkOpen(); try { return ((CallableStatement)getDelegate()).getTimestamp( parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
138
139    @Override
140    public Object getObject(int parameterIndex) throws SQLException
141    { checkOpen(); try { return ((CallableStatement)getDelegate()).getObject( parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
142
143    @Override
144    public BigDecimal getBigDecimal(int parameterIndex) throws SQLException
145    { checkOpen(); try { return ((CallableStatement)getDelegate()).getBigDecimal( parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
146
147    @Override
148    public Object getObject(int i, Map<String,Class<?>> map) throws SQLException
149    { checkOpen(); try { return ((CallableStatement)getDelegate()).getObject( i, map); } catch (SQLException e) { handleException(e); return null; } }
150
151    @Override
152    public Ref getRef(int i) throws SQLException
153    { checkOpen(); try { return ((CallableStatement)getDelegate()).getRef( i); } catch (SQLException e) { handleException(e); return null; } }
154
155    @Override
156    public Blob getBlob(int i) throws SQLException
157    { checkOpen(); try { return ((CallableStatement)getDelegate()).getBlob( i); } catch (SQLException e) { handleException(e); return null; } }
158
159    @Override
160    public Clob getClob(int i) throws SQLException
161    { checkOpen(); try { return ((CallableStatement)getDelegate()).getClob( i); } catch (SQLException e) { handleException(e); return null; } }
162
163    @Override
164    public Array getArray(int i) throws SQLException
165    { checkOpen(); try { return ((CallableStatement)getDelegate()).getArray( i); } catch (SQLException e) { handleException(e); return null; } }
166
167    @Override
168    public Date getDate(int parameterIndex, Calendar cal) throws SQLException
169    { checkOpen(); try { return ((CallableStatement)getDelegate()).getDate( parameterIndex,  cal); } catch (SQLException e) { handleException(e); return null; } }
170
171    @Override
172    public Time getTime(int parameterIndex, Calendar cal) throws SQLException
173    { checkOpen(); try { return ((CallableStatement)getDelegate()).getTime( parameterIndex,  cal); } catch (SQLException e) { handleException(e); return null; } }
174
175    @Override
176    public Timestamp getTimestamp(int parameterIndex, Calendar cal) throws SQLException
177    { checkOpen(); try { return ((CallableStatement)getDelegate()).getTimestamp( parameterIndex,  cal); } catch (SQLException e) { handleException(e); return null; } }
178
179    @Override
180    public void registerOutParameter(int paramIndex, int sqlType, String typeName) throws SQLException
181    { checkOpen(); try { ((CallableStatement)getDelegate()).registerOutParameter( paramIndex,  sqlType,  typeName); } catch (SQLException e) { handleException(e); } }
182
183    @Override
184    public void registerOutParameter(String parameterName, int sqlType) throws SQLException
185    { checkOpen(); try { ((CallableStatement)getDelegate()).registerOutParameter(parameterName, sqlType); } catch (SQLException e) { handleException(e); } }
186
187    @Override
188    public void registerOutParameter(String parameterName, int sqlType, int scale) throws SQLException
189    { checkOpen(); try { ((CallableStatement)getDelegate()).registerOutParameter(parameterName, sqlType, scale); } catch (SQLException e) { handleException(e); } }
190
191    @Override
192    public void registerOutParameter(String parameterName, int sqlType, String typeName) throws SQLException
193    { checkOpen(); try { ((CallableStatement)getDelegate()).registerOutParameter(parameterName, sqlType, typeName); } catch (SQLException e) { handleException(e); } }
194
195    @Override
196    public URL getURL(int parameterIndex) throws SQLException
197    { checkOpen(); try { return ((CallableStatement)getDelegate()).getURL(parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
198
199    @Override
200    public void setURL(String parameterName, URL val) throws SQLException
201    { checkOpen(); try { ((CallableStatement)getDelegate()).setURL(parameterName, val); } catch (SQLException e) { handleException(e); } }
202
203    @Override
204    public void setNull(String parameterName, int sqlType) throws SQLException
205    { checkOpen(); try { ((CallableStatement)getDelegate()).setNull(parameterName, sqlType); } catch (SQLException e) { handleException(e); } }
206
207    @Override
208    public void setBoolean(String parameterName, boolean x) throws SQLException
209    { checkOpen(); try { ((CallableStatement)getDelegate()).setBoolean(parameterName, x); } catch (SQLException e) { handleException(e); } }
210
211    @Override
212    public void setByte(String parameterName, byte x) throws SQLException
213    { checkOpen(); try { ((CallableStatement)getDelegate()).setByte(parameterName, x); } catch (SQLException e) { handleException(e); } }
214
215    @Override
216    public void setShort(String parameterName, short x) throws SQLException
217    { checkOpen(); try { ((CallableStatement)getDelegate()).setShort(parameterName, x); } catch (SQLException e) { handleException(e); } }
218
219    @Override
220    public void setInt(String parameterName, int x) throws SQLException
221    { checkOpen(); try { ((CallableStatement)getDelegate()).setInt(parameterName, x); } catch (SQLException e) { handleException(e); } }
222
223    @Override
224    public void setLong(String parameterName, long x) throws SQLException
225    { checkOpen(); try { ((CallableStatement)getDelegate()).setLong(parameterName, x); } catch (SQLException e) { handleException(e); } }
226
227    @Override
228    public void setFloat(String parameterName, float x) throws SQLException
229    { checkOpen(); try { ((CallableStatement)getDelegate()).setFloat(parameterName, x); } catch (SQLException e) { handleException(e); } }
230
231    @Override
232    public void setDouble(String parameterName, double x) throws SQLException
233    { checkOpen(); try { ((CallableStatement)getDelegate()).setDouble(parameterName, x); } catch (SQLException e) { handleException(e); } }
234
235    @Override
236    public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException
237    { checkOpen(); try { ((CallableStatement)getDelegate()).setBigDecimal(parameterName, x); } catch (SQLException e) { handleException(e); } }
238
239    @Override
240    public void setString(String parameterName, String x) throws SQLException
241    { checkOpen(); try { ((CallableStatement)getDelegate()).setString(parameterName, x); } catch (SQLException e) { handleException(e); } }
242
243    @Override
244    public void setBytes(String parameterName, byte [] x) throws SQLException
245    { checkOpen(); try { ((CallableStatement)getDelegate()).setBytes(parameterName, x); } catch (SQLException e) { handleException(e); } }
246
247    @Override
248    public void setDate(String parameterName, Date x) throws SQLException
249    { checkOpen(); try { ((CallableStatement)getDelegate()).setDate(parameterName, x); } catch (SQLException e) { handleException(e); } }
250
251    @Override
252    public void setTime(String parameterName, Time x) throws SQLException
253    { checkOpen(); try { ((CallableStatement)getDelegate()).setTime(parameterName, x); } catch (SQLException e) { handleException(e); } }
254
255    @Override
256    public void setTimestamp(String parameterName, Timestamp x) throws SQLException
257    { checkOpen(); try { ((CallableStatement)getDelegate()).setTimestamp(parameterName, x); } catch (SQLException e) { handleException(e); } }
258
259    @Override
260    public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException
261    { checkOpen(); try { ((CallableStatement)getDelegate()).setAsciiStream(parameterName, x, length); } catch (SQLException e) { handleException(e); } }
262
263    @Override
264    public void setBinaryStream(String parameterName, InputStream x, int length) throws SQLException
265    { checkOpen(); try { ((CallableStatement)getDelegate()).setBinaryStream(parameterName, x, length); } catch (SQLException e) { handleException(e); } }
266
267    @Override
268    public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException
269    { checkOpen(); try { ((CallableStatement)getDelegate()).setObject(parameterName, x, targetSqlType, scale); } catch (SQLException e) { handleException(e); } }
270
271    @Override
272    public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException
273    { checkOpen(); try { ((CallableStatement)getDelegate()).setObject(parameterName, x, targetSqlType); } catch (SQLException e) { handleException(e); } }
274
275    @Override
276    public void setObject(String parameterName, Object x) throws SQLException
277    { checkOpen(); try { ((CallableStatement)getDelegate()).setObject(parameterName, x); } catch (SQLException e) { handleException(e); } }
278
279    @Override
280    public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException
281    { checkOpen(); ((CallableStatement)getDelegate()).setCharacterStream(parameterName, reader, length); }
282
283    @Override
284    public void setDate(String parameterName, Date x, Calendar cal) throws SQLException
285    { checkOpen(); try { ((CallableStatement)getDelegate()).setDate(parameterName, x, cal); } catch (SQLException e) { handleException(e); } }
286
287    @Override
288    public void setTime(String parameterName, Time x, Calendar cal) throws SQLException
289    { checkOpen(); try { ((CallableStatement)getDelegate()).setTime(parameterName, x, cal); } catch (SQLException e) { handleException(e); } }
290
291    @Override
292    public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException
293    { checkOpen(); try { ((CallableStatement)getDelegate()).setTimestamp(parameterName, x, cal); } catch (SQLException e) { handleException(e); } }
294
295    @Override
296    public void setNull(String parameterName, int sqlType, String typeName) throws SQLException
297    { checkOpen(); try { ((CallableStatement)getDelegate()).setNull(parameterName, sqlType, typeName); } catch (SQLException e) { handleException(e); } }
298
299    @Override
300    public String getString(String parameterName) throws SQLException
301    { checkOpen(); try { return ((CallableStatement)getDelegate()).getString(parameterName); } catch (SQLException e) { handleException(e); return null; } }
302
303    @Override
304    public boolean getBoolean(String parameterName) throws SQLException
305    { checkOpen(); try { return ((CallableStatement)getDelegate()).getBoolean(parameterName); } catch (SQLException e) { handleException(e); return false; } }
306
307    @Override
308    public byte getByte(String parameterName) throws SQLException
309    { checkOpen(); try { return ((CallableStatement)getDelegate()).getByte(parameterName); } catch (SQLException e) { handleException(e); return 0; } }
310
311    @Override
312    public short getShort(String parameterName) throws SQLException
313    { checkOpen(); try { return ((CallableStatement)getDelegate()).getShort(parameterName); } catch (SQLException e) { handleException(e); return 0; } }
314
315    @Override
316    public int getInt(String parameterName) throws SQLException
317    { checkOpen(); try { return ((CallableStatement)getDelegate()).getInt(parameterName); } catch (SQLException e) { handleException(e); return 0; } }
318
319    @Override
320    public long getLong(String parameterName) throws SQLException
321    { checkOpen(); try { return ((CallableStatement)getDelegate()).getLong(parameterName); } catch (SQLException e) { handleException(e); return 0; } }
322
323    @Override
324    public float getFloat(String parameterName) throws SQLException
325    { checkOpen(); try { return ((CallableStatement)getDelegate()).getFloat(parameterName); } catch (SQLException e) { handleException(e); return 0; } }
326
327    @Override
328    public double getDouble(String parameterName) throws SQLException
329    { checkOpen(); try { return ((CallableStatement)getDelegate()).getDouble(parameterName); } catch (SQLException e) { handleException(e); return 0; } }
330
331    @Override
332    public byte[] getBytes(String parameterName) throws SQLException
333    { checkOpen(); try { return ((CallableStatement)getDelegate()).getBytes(parameterName); } catch (SQLException e) { handleException(e); return null; } }
334
335    @Override
336    public Date getDate(String parameterName) throws SQLException
337    { checkOpen(); try { return ((CallableStatement)getDelegate()).getDate(parameterName); } catch (SQLException e) { handleException(e); return null; } }
338
339    @Override
340    public Time getTime(String parameterName) throws SQLException
341    { checkOpen(); try { return ((CallableStatement)getDelegate()).getTime(parameterName); } catch (SQLException e) { handleException(e); return null; } }
342
343    @Override
344    public Timestamp getTimestamp(String parameterName) throws SQLException
345    { checkOpen(); try { return ((CallableStatement)getDelegate()).getTimestamp(parameterName); } catch (SQLException e) { handleException(e); return null; } }
346
347    @Override
348    public Object getObject(String parameterName) throws SQLException
349    { checkOpen(); try { return ((CallableStatement)getDelegate()).getObject(parameterName); } catch (SQLException e) { handleException(e); return null; } }
350
351    @Override
352    public BigDecimal getBigDecimal(String parameterName) throws SQLException
353    { checkOpen(); try { return ((CallableStatement)getDelegate()).getBigDecimal(parameterName); } catch (SQLException e) { handleException(e); return null; } }
354
355    @Override
356    public Object getObject(String parameterName, Map<String,Class<?>> map) throws SQLException
357    { checkOpen(); try { return ((CallableStatement)getDelegate()).getObject(parameterName, map); } catch (SQLException e) { handleException(e); return null; } }
358
359    @Override
360    public Ref getRef(String parameterName) throws SQLException
361    { checkOpen(); try { return ((CallableStatement)getDelegate()).getRef(parameterName); } catch (SQLException e) { handleException(e); return null; } }
362
363    @Override
364    public Blob getBlob(String parameterName) throws SQLException
365    { checkOpen(); try { return ((CallableStatement)getDelegate()).getBlob(parameterName); } catch (SQLException e) { handleException(e); return null; } }
366
367    @Override
368    public Clob getClob(String parameterName) throws SQLException
369    { checkOpen(); try { return ((CallableStatement)getDelegate()).getClob(parameterName); } catch (SQLException e) { handleException(e); return null; } }
370
371    @Override
372    public Array getArray(String parameterName) throws SQLException
373    { checkOpen(); try { return ((CallableStatement)getDelegate()).getArray(parameterName); } catch (SQLException e) { handleException(e); return null; } }
374
375    @Override
376    public Date getDate(String parameterName, Calendar cal) throws SQLException
377    { checkOpen(); try { return ((CallableStatement)getDelegate()).getDate(parameterName, cal); } catch (SQLException e) { handleException(e); return null; } }
378
379    @Override
380    public Time getTime(String parameterName, Calendar cal) throws SQLException
381    { checkOpen(); try { return ((CallableStatement)getDelegate()).getTime(parameterName, cal); } catch (SQLException e) { handleException(e); return null; } }
382
383    @Override
384    public Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException
385    { checkOpen(); try { return ((CallableStatement)getDelegate()).getTimestamp(parameterName, cal); } catch (SQLException e) { handleException(e); return null; } }
386
387    @Override
388    public URL getURL(String parameterName) throws SQLException
389    { checkOpen(); try { return ((CallableStatement)getDelegate()).getURL(parameterName); } catch (SQLException e) { handleException(e); return null; } }
390
391
392    @Override
393    public RowId getRowId(int parameterIndex) throws SQLException {
394        checkOpen();
395        try {
396            return ((CallableStatement)getDelegate()).getRowId(parameterIndex);
397        }
398        catch (SQLException e) {
399            handleException(e);
400            return null;
401        }
402    }
403
404    @Override
405    public RowId getRowId(String parameterName) throws SQLException {
406        checkOpen();
407        try {
408            return ((CallableStatement)getDelegate()).getRowId(parameterName);
409        }
410        catch (SQLException e) {
411            handleException(e);
412            return null;
413        }
414    }
415
416    @Override
417    public void setRowId(String parameterName, RowId value) throws SQLException {
418        checkOpen();
419        try {
420            ((CallableStatement)getDelegate()).setRowId(parameterName, value);
421        }
422        catch (SQLException e) {
423            handleException(e);
424        }
425    }
426
427    @Override
428    public void setNString(String parameterName, String value) throws SQLException {
429        checkOpen();
430        try {
431            ((CallableStatement)getDelegate()).setNString(parameterName, value);
432        }
433        catch (SQLException e) {
434            handleException(e);
435        }
436    }
437
438    @Override
439    public void setNCharacterStream(String parameterName, Reader reader, long length) throws SQLException {
440        checkOpen();
441        try {
442            ((CallableStatement)getDelegate()).setNCharacterStream(parameterName, reader, length);
443        }
444        catch (SQLException e) {
445            handleException(e);
446        }
447    }
448
449    @Override
450    public void setNClob(String parameterName, NClob value) throws SQLException {
451        checkOpen();
452        try {
453            ((CallableStatement)getDelegate()).setNClob(parameterName, value);
454        }
455        catch (SQLException e) {
456            handleException(e);
457        }
458    }
459
460    @Override
461    public void setClob(String parameterName, Reader reader, long length) throws SQLException {
462        checkOpen();
463        try {
464            ((CallableStatement)getDelegate()).setClob(parameterName, reader, length);
465        }
466        catch (SQLException e) {
467            handleException(e);
468        }
469    }
470
471    @Override
472    public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException {
473        checkOpen();
474        try {
475            ((CallableStatement)getDelegate()).setBlob(parameterName, inputStream, length);
476        }
477        catch (SQLException e) {
478            handleException(e);
479        }
480    }
481
482    @Override
483    public void setNClob(String parameterName, Reader reader, long length) throws SQLException {
484        checkOpen();
485        try {
486            ((CallableStatement)getDelegate()).setNClob(parameterName, reader, length);
487        }
488        catch (SQLException e) {
489            handleException(e);
490        }
491    }
492
493    @Override
494    public NClob getNClob(int parameterIndex) throws SQLException {
495        checkOpen();
496        try {
497            return ((CallableStatement)getDelegate()).getNClob(parameterIndex);
498        }
499        catch (SQLException e) {
500            handleException(e);
501            return null;
502        }
503    }
504
505    @Override
506    public NClob getNClob(String parameterName) throws SQLException {
507        checkOpen();
508        try {
509            return ((CallableStatement)getDelegate()).getNClob(parameterName);
510        }
511        catch (SQLException e) {
512            handleException(e);
513            return null;
514        }
515    }
516
517    @Override
518    public void setSQLXML(String parameterName, SQLXML value) throws SQLException {
519        checkOpen();
520        try {
521            ((CallableStatement)getDelegate()).setSQLXML(parameterName, value);
522        }
523        catch (SQLException e) {
524            handleException(e);
525        }
526    }
527
528    @Override
529    public SQLXML getSQLXML(int parameterIndex) throws SQLException {
530        checkOpen();
531        try {
532            return ((CallableStatement)getDelegate()).getSQLXML(parameterIndex);
533        }
534        catch (SQLException e) {
535            handleException(e);
536            return null;
537        }
538    }
539
540    @Override
541    public SQLXML getSQLXML(String parameterName) throws SQLException {
542        checkOpen();
543        try {
544            return ((CallableStatement)getDelegate()).getSQLXML(parameterName);
545        }
546        catch (SQLException e) {
547            handleException(e);
548            return null;
549        }
550    }
551
552    @Override
553    public String getNString(int parameterIndex) throws SQLException {
554        checkOpen();
555        try {
556            return ((CallableStatement)getDelegate()).getNString(parameterIndex);
557        }
558        catch (SQLException e) {
559            handleException(e);
560            return null;
561        }
562    }
563
564    @Override
565    public String getNString(String parameterName) throws SQLException {
566        checkOpen();
567        try {
568            return ((CallableStatement)getDelegate()).getNString(parameterName);
569        }
570        catch (SQLException e) {
571            handleException(e);
572            return null;
573        }
574    }
575
576    @Override
577    public Reader getNCharacterStream(int parameterIndex) throws SQLException {
578        checkOpen();
579        try {
580            return ((CallableStatement)getDelegate()).getNCharacterStream(parameterIndex);
581        }
582        catch (SQLException e) {
583            handleException(e);
584            return null;
585        }
586    }
587
588    @Override
589    public Reader getNCharacterStream(String parameterName) throws SQLException {
590        checkOpen();
591        try {
592            return ((CallableStatement)getDelegate()).getNCharacterStream(parameterName);
593        }
594        catch (SQLException e) {
595            handleException(e);
596            return null;
597        }
598    }
599
600    @Override
601    public Reader getCharacterStream(int parameterIndex) throws SQLException {
602        checkOpen();
603        try {
604            return ((CallableStatement)getDelegate()).getCharacterStream(parameterIndex);
605        }
606        catch (SQLException e) {
607            handleException(e);
608            return null;
609        }
610    }
611
612    @Override
613    public Reader getCharacterStream(String parameterName) throws SQLException {
614        checkOpen();
615        try {
616            return ((CallableStatement)getDelegate()).getCharacterStream(parameterName);
617        }
618        catch (SQLException e) {
619            handleException(e);
620            return null;
621        }
622    }
623
624    @Override
625    public void setBlob(String parameterName, Blob blob) throws SQLException {
626        checkOpen();
627        try {
628            ((CallableStatement)getDelegate()).setBlob(parameterName, blob);
629        }
630        catch (SQLException e) {
631            handleException(e);
632        }
633    }
634
635    @Override
636    public void setClob(String parameterName, Clob clob) throws SQLException {
637        checkOpen();
638        try {
639            ((CallableStatement)getDelegate()).setClob(parameterName, clob);
640        }
641        catch (SQLException e) {
642            handleException(e);
643        }
644    }
645
646    @Override
647    public void setAsciiStream(String parameterName, InputStream inputStream, long length) throws SQLException {
648        checkOpen();
649        try {
650            ((CallableStatement)getDelegate()).setAsciiStream(parameterName, inputStream, length);
651        }
652        catch (SQLException e) {
653            handleException(e);
654        }
655    }
656
657    @Override
658    public void setBinaryStream(String parameterName, InputStream inputStream, long length) throws SQLException {
659        checkOpen();
660        try {
661            ((CallableStatement)getDelegate()).setBinaryStream(parameterName, inputStream, length);
662        }
663        catch (SQLException e) {
664            handleException(e);
665        }
666    }
667
668    @Override
669    public void setCharacterStream(String parameterName, Reader reader, long length) throws SQLException {
670        checkOpen();
671        try {
672            ((CallableStatement)getDelegate()).setCharacterStream(parameterName, reader, length);
673        }
674        catch (SQLException e) {
675            handleException(e);
676        }
677    }
678
679    @Override
680    public void setAsciiStream(String parameterName, InputStream inputStream) throws SQLException {
681        checkOpen();
682        try {
683            ((CallableStatement)getDelegate()).setAsciiStream(parameterName, inputStream);
684        }
685        catch (SQLException e) {
686            handleException(e);
687        }
688    }
689
690    @Override
691    public void setBinaryStream(String parameterName, InputStream inputStream) throws SQLException {
692        checkOpen();
693        try {
694            ((CallableStatement)getDelegate()).setBinaryStream(parameterName, inputStream);
695        }
696        catch (SQLException e) {
697            handleException(e);
698        }
699    }
700
701    @Override
702    public void setCharacterStream(String parameterName, Reader reader) throws SQLException {
703        checkOpen();
704        try {
705            ((CallableStatement)getDelegate()).setCharacterStream(parameterName, reader);
706        }
707        catch (SQLException e) {
708            handleException(e);
709        }
710    }
711
712    @Override
713    public void setNCharacterStream(String parameterName, Reader reader) throws SQLException {
714        checkOpen();
715        try {
716            ((CallableStatement)getDelegate()).setNCharacterStream(parameterName, reader);
717        }
718        catch (SQLException e) {
719            handleException(e);
720        }
721    }
722
723    @Override
724    public void setClob(String parameterName, Reader reader) throws SQLException {
725        checkOpen();
726        try {
727            ((CallableStatement)getDelegate()).setClob(parameterName, reader);
728        }
729        catch (SQLException e) {
730            handleException(e);
731        }
732    }
733
734    @Override
735    public void setBlob(String parameterName, InputStream inputStream) throws SQLException {
736        checkOpen();
737        try {
738            ((CallableStatement)getDelegate()).setBlob(parameterName, inputStream);
739        }
740        catch (SQLException e) {
741            handleException(e);
742        }
743    }
744
745    @Override
746    public void setNClob(String parameterName, Reader reader) throws SQLException {
747        checkOpen();
748        try {
749            ((CallableStatement)getDelegate()).setNClob(parameterName, reader);
750        }
751        catch (SQLException e) {
752            handleException(e);
753        }
754    }
755
756    @Override
757    public <T> T getObject(int parameterIndex, Class<T> type)
758            throws SQLException {
759        checkOpen();
760        try {
761            return ((CallableStatement)getDelegate()).getObject(parameterIndex, type);
762}
763        catch (SQLException e) {
764            handleException(e);
765            return null;
766        }
767    }
768
769    @Override
770    public <T> T getObject(String parameterName, Class<T> type)
771            throws SQLException {
772        checkOpen();
773        try {
774            return ((CallableStatement)getDelegate()).getObject(parameterName, type);
775        }
776        catch (SQLException e) {
777            handleException(e);
778            return null;
779        }
780    }
781
782
783}