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    
018    package org.apache.commons.dbcp;
019    
020    import java.net.URL;
021    import java.sql.CallableStatement;
022    import java.math.BigDecimal;
023    import java.sql.Date;
024    import java.sql.Time;
025    import java.sql.Timestamp;
026    import java.util.Map;
027    import java.sql.Ref;
028    import java.sql.Blob;
029    import java.sql.Clob;
030    import java.sql.Array;
031    import java.util.Calendar;
032    import java.io.InputStream;
033    import java.io.Reader;
034    import java.sql.SQLException;
035    /* JDBC_4_ANT_KEY_BEGIN */
036    import java.sql.NClob;
037    import java.sql.RowId;
038    import java.sql.SQLXML;
039    /* JDBC_4_ANT_KEY_END */
040    
041    /**
042     * A base delegating implementation of {@link CallableStatement}.
043     * <p>
044     * All of the methods from the {@link CallableStatement} interface
045     * simply call the corresponding method on the "delegate"
046     * provided in my constructor.
047     * <p>
048     * Extends AbandonedTrace to implement Statement tracking and
049     * logging of code which created the Statement. Tracking the
050     * Statement ensures that the Connection which created it can
051     * close any open Statement's on Connection close.
052     *
053     * @author Glenn L. Nielsen
054     * @author James House
055     * @author Dirk Verbeeck
056     * @version $Revision: 892307 $ $Date: 2013-12-31 23:27:28 +0000 (Tue, 31 Dec 2013) $
057     */
058    public class DelegatingCallableStatement extends DelegatingPreparedStatement
059            implements CallableStatement {
060    
061        /**
062         * Create a wrapper for the Statement which traces this
063         * Statement to the Connection which created it and the
064         * code which created it.
065         *
066         * @param c the {@link DelegatingConnection} that created this statement
067         * @param s the {@link CallableStatement} to delegate all calls to
068         */
069        public DelegatingCallableStatement(DelegatingConnection c,
070                                           CallableStatement s) {
071            super(c, s);
072        }
073    
074        public boolean equals(Object obj) {
075            CallableStatement delegate = (CallableStatement) getInnermostDelegate();
076            if (delegate == null) {
077                return false;
078            }
079            if (obj instanceof DelegatingCallableStatement) {
080                DelegatingCallableStatement s = (DelegatingCallableStatement) obj;
081                return delegate.equals(s.getInnermostDelegate());
082            }
083            else {
084                return delegate.equals(obj);
085            }
086        }
087    
088        /** Sets my delegate. */
089        public void setDelegate(CallableStatement s) {
090            super.setDelegate(s);
091            _stmt = s;
092        }
093    
094        public void registerOutParameter(int parameterIndex, int sqlType) throws SQLException
095        { checkOpen(); try { ((CallableStatement)_stmt).registerOutParameter( parameterIndex,  sqlType); } catch (SQLException e) { handleException(e); } }
096    
097        public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws SQLException
098        { checkOpen(); try { ((CallableStatement)_stmt).registerOutParameter( parameterIndex,  sqlType,  scale); } catch (SQLException e) { handleException(e); } }
099    
100        public boolean wasNull() throws SQLException
101        { checkOpen(); try { return ((CallableStatement)_stmt).wasNull(); } catch (SQLException e) { handleException(e); return false; } }
102    
103        public String getString(int parameterIndex) throws SQLException
104        { checkOpen(); try { return ((CallableStatement)_stmt).getString( parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
105    
106        public boolean getBoolean(int parameterIndex) throws SQLException
107        { checkOpen(); try { return ((CallableStatement)_stmt).getBoolean( parameterIndex); } catch (SQLException e) { handleException(e); return false; } }
108    
109        public byte getByte(int parameterIndex) throws SQLException
110        { checkOpen(); try { return ((CallableStatement)_stmt).getByte( parameterIndex); } catch (SQLException e) { handleException(e); return 0; } }
111    
112        public short getShort(int parameterIndex) throws SQLException
113        { checkOpen(); try { return ((CallableStatement)_stmt).getShort( parameterIndex); } catch (SQLException e) { handleException(e); return 0; } }
114    
115        public int getInt(int parameterIndex) throws SQLException
116        { checkOpen(); try { return ((CallableStatement)_stmt).getInt( parameterIndex); } catch (SQLException e) { handleException(e); return 0; } }
117    
118        public long getLong(int parameterIndex) throws SQLException
119        { checkOpen(); try { return ((CallableStatement)_stmt).getLong( parameterIndex); } catch (SQLException e) { handleException(e); return 0; } }
120    
121        public float getFloat(int parameterIndex) throws SQLException
122        { checkOpen(); try { return ((CallableStatement)_stmt).getFloat( parameterIndex); } catch (SQLException e) { handleException(e); return 0; } }
123    
124        public double getDouble(int parameterIndex) throws SQLException
125        { checkOpen(); try { return ((CallableStatement)_stmt).getDouble( parameterIndex); } catch (SQLException e) { handleException(e); return 0; } }
126    
127        /** @deprecated */
128        public BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException
129        { checkOpen(); try { return ((CallableStatement)_stmt).getBigDecimal( parameterIndex,  scale); } catch (SQLException e) { handleException(e); return null; } }
130    
131        public byte[] getBytes(int parameterIndex) throws SQLException
132        { checkOpen(); try { return ((CallableStatement)_stmt).getBytes( parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
133    
134        public Date getDate(int parameterIndex) throws SQLException
135        { checkOpen(); try { return ((CallableStatement)_stmt).getDate( parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
136    
137        public Time getTime(int parameterIndex) throws SQLException
138        { checkOpen(); try { return ((CallableStatement)_stmt).getTime( parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
139    
140        public Timestamp getTimestamp(int parameterIndex) throws SQLException
141        { checkOpen(); try { return ((CallableStatement)_stmt).getTimestamp( parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
142    
143        public Object getObject(int parameterIndex) throws SQLException
144        { checkOpen(); try { return ((CallableStatement)_stmt).getObject( parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
145    
146        public BigDecimal getBigDecimal(int parameterIndex) throws SQLException
147        { checkOpen(); try { return ((CallableStatement)_stmt).getBigDecimal( parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
148    
149        public Object getObject(int i, Map map) throws SQLException
150        { checkOpen(); try { return ((CallableStatement)_stmt).getObject( i, map); } catch (SQLException e) { handleException(e); return null; } }
151    
152        public Ref getRef(int i) throws SQLException
153        { checkOpen(); try { return ((CallableStatement)_stmt).getRef( i); } catch (SQLException e) { handleException(e); return null; } }
154    
155        public Blob getBlob(int i) throws SQLException
156        { checkOpen(); try { return ((CallableStatement)_stmt).getBlob( i); } catch (SQLException e) { handleException(e); return null; } }
157    
158        public Clob getClob(int i) throws SQLException
159        { checkOpen(); try { return ((CallableStatement)_stmt).getClob( i); } catch (SQLException e) { handleException(e); return null; } }
160    
161        public Array getArray(int i) throws SQLException
162        { checkOpen(); try { return ((CallableStatement)_stmt).getArray( i); } catch (SQLException e) { handleException(e); return null; } }
163    
164        public Date getDate(int parameterIndex, Calendar cal) throws SQLException
165        { checkOpen(); try { return ((CallableStatement)_stmt).getDate( parameterIndex,  cal); } catch (SQLException e) { handleException(e); return null; } }
166    
167        public Time getTime(int parameterIndex, Calendar cal) throws SQLException
168        { checkOpen(); try { return ((CallableStatement)_stmt).getTime( parameterIndex,  cal); } catch (SQLException e) { handleException(e); return null; } }
169    
170        public Timestamp getTimestamp(int parameterIndex, Calendar cal) throws SQLException
171        { checkOpen(); try { return ((CallableStatement)_stmt).getTimestamp( parameterIndex,  cal); } catch (SQLException e) { handleException(e); return null; } }
172    
173        public void registerOutParameter(int paramIndex, int sqlType, String typeName) throws SQLException
174        { checkOpen(); try { ((CallableStatement)_stmt).registerOutParameter( paramIndex,  sqlType,  typeName); } catch (SQLException e) { handleException(e); } }
175    
176        public void registerOutParameter(String parameterName, int sqlType) throws SQLException
177        { checkOpen(); try { ((CallableStatement)_stmt).registerOutParameter(parameterName, sqlType); } catch (SQLException e) { handleException(e); } }
178    
179        public void registerOutParameter(String parameterName, int sqlType, int scale) throws SQLException
180        { checkOpen(); try { ((CallableStatement)_stmt).registerOutParameter(parameterName, sqlType, scale); } catch (SQLException e) { handleException(e); } }
181    
182        public void registerOutParameter(String parameterName, int sqlType, String typeName) throws SQLException
183        { checkOpen(); try { ((CallableStatement)_stmt).registerOutParameter(parameterName, sqlType, typeName); } catch (SQLException e) { handleException(e); } }
184    
185        public URL getURL(int parameterIndex) throws SQLException
186        { checkOpen(); try { return ((CallableStatement)_stmt).getURL(parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
187    
188        public void setURL(String parameterName, URL val) throws SQLException
189        { checkOpen(); try { ((CallableStatement)_stmt).setURL(parameterName, val); } catch (SQLException e) { handleException(e); } }
190    
191        public void setNull(String parameterName, int sqlType) throws SQLException
192        { checkOpen(); try { ((CallableStatement)_stmt).setNull(parameterName, sqlType); } catch (SQLException e) { handleException(e); } }
193    
194        public void setBoolean(String parameterName, boolean x) throws SQLException
195        { checkOpen(); try { ((CallableStatement)_stmt).setBoolean(parameterName, x); } catch (SQLException e) { handleException(e); } }
196    
197        public void setByte(String parameterName, byte x) throws SQLException
198        { checkOpen(); try { ((CallableStatement)_stmt).setByte(parameterName, x); } catch (SQLException e) { handleException(e); } }
199    
200        public void setShort(String parameterName, short x) throws SQLException
201        { checkOpen(); try { ((CallableStatement)_stmt).setShort(parameterName, x); } catch (SQLException e) { handleException(e); } }
202    
203        public void setInt(String parameterName, int x) throws SQLException
204        { checkOpen(); try { ((CallableStatement)_stmt).setInt(parameterName, x); } catch (SQLException e) { handleException(e); } }
205    
206        public void setLong(String parameterName, long x) throws SQLException
207        { checkOpen(); try { ((CallableStatement)_stmt).setLong(parameterName, x); } catch (SQLException e) { handleException(e); } }
208    
209        public void setFloat(String parameterName, float x) throws SQLException
210        { checkOpen(); try { ((CallableStatement)_stmt).setFloat(parameterName, x); } catch (SQLException e) { handleException(e); } }
211    
212        public void setDouble(String parameterName, double x) throws SQLException
213        { checkOpen(); try { ((CallableStatement)_stmt).setDouble(parameterName, x); } catch (SQLException e) { handleException(e); } }
214    
215        public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException
216        { checkOpen(); try { ((CallableStatement)_stmt).setBigDecimal(parameterName, x); } catch (SQLException e) { handleException(e); } }
217    
218        public void setString(String parameterName, String x) throws SQLException
219        { checkOpen(); try { ((CallableStatement)_stmt).setString(parameterName, x); } catch (SQLException e) { handleException(e); } }
220    
221        public void setBytes(String parameterName, byte [] x) throws SQLException
222        { checkOpen(); try { ((CallableStatement)_stmt).setBytes(parameterName, x); } catch (SQLException e) { handleException(e); } }
223    
224        public void setDate(String parameterName, Date x) throws SQLException
225        { checkOpen(); try { ((CallableStatement)_stmt).setDate(parameterName, x); } catch (SQLException e) { handleException(e); } }
226    
227        public void setTime(String parameterName, Time x) throws SQLException
228        { checkOpen(); try { ((CallableStatement)_stmt).setTime(parameterName, x); } catch (SQLException e) { handleException(e); } }
229    
230        public void setTimestamp(String parameterName, Timestamp x) throws SQLException
231        { checkOpen(); try { ((CallableStatement)_stmt).setTimestamp(parameterName, x); } catch (SQLException e) { handleException(e); } }
232    
233        public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException
234        { checkOpen(); try { ((CallableStatement)_stmt).setAsciiStream(parameterName, x, length); } catch (SQLException e) { handleException(e); } }
235    
236        public void setBinaryStream(String parameterName, InputStream x, int length) throws SQLException
237        { checkOpen(); try { ((CallableStatement)_stmt).setBinaryStream(parameterName, x, length); } catch (SQLException e) { handleException(e); } }
238    
239        public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException
240        { checkOpen(); try { ((CallableStatement)_stmt).setObject(parameterName, x, targetSqlType, scale); } catch (SQLException e) { handleException(e); } }
241    
242        public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException
243        { checkOpen(); try { ((CallableStatement)_stmt).setObject(parameterName, x, targetSqlType); } catch (SQLException e) { handleException(e); } }
244    
245        public void setObject(String parameterName, Object x) throws SQLException
246        { checkOpen(); try { ((CallableStatement)_stmt).setObject(parameterName, x); } catch (SQLException e) { handleException(e); } }
247    
248        public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException
249        { checkOpen(); ((CallableStatement)_stmt).setCharacterStream(parameterName, reader, length); }
250    
251        public void setDate(String parameterName, Date x, Calendar cal) throws SQLException
252        { checkOpen(); try { ((CallableStatement)_stmt).setDate(parameterName, x, cal); } catch (SQLException e) { handleException(e); } }
253    
254        public void setTime(String parameterName, Time x, Calendar cal) throws SQLException
255        { checkOpen(); try { ((CallableStatement)_stmt).setTime(parameterName, x, cal); } catch (SQLException e) { handleException(e); } }
256    
257        public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException
258        { checkOpen(); try { ((CallableStatement)_stmt).setTimestamp(parameterName, x, cal); } catch (SQLException e) { handleException(e); } }
259    
260        public void setNull(String parameterName, int sqlType, String typeName) throws SQLException
261        { checkOpen(); try { ((CallableStatement)_stmt).setNull(parameterName, sqlType, typeName); } catch (SQLException e) { handleException(e); } }
262    
263        public String getString(String parameterName) throws SQLException
264        { checkOpen(); try { return ((CallableStatement)_stmt).getString(parameterName); } catch (SQLException e) { handleException(e); return null; } }
265    
266        public boolean getBoolean(String parameterName) throws SQLException
267        { checkOpen(); try { return ((CallableStatement)_stmt).getBoolean(parameterName); } catch (SQLException e) { handleException(e); return false; } }
268    
269        public byte getByte(String parameterName) throws SQLException
270        { checkOpen(); try { return ((CallableStatement)_stmt).getByte(parameterName); } catch (SQLException e) { handleException(e); return 0; } }
271    
272        public short getShort(String parameterName) throws SQLException
273        { checkOpen(); try { return ((CallableStatement)_stmt).getShort(parameterName); } catch (SQLException e) { handleException(e); return 0; } }
274    
275        public int getInt(String parameterName) throws SQLException
276        { checkOpen(); try { return ((CallableStatement)_stmt).getInt(parameterName); } catch (SQLException e) { handleException(e); return 0; } }
277    
278        public long getLong(String parameterName) throws SQLException
279        { checkOpen(); try { return ((CallableStatement)_stmt).getLong(parameterName); } catch (SQLException e) { handleException(e); return 0; } }
280    
281        public float getFloat(String parameterName) throws SQLException
282        { checkOpen(); try { return ((CallableStatement)_stmt).getFloat(parameterName); } catch (SQLException e) { handleException(e); return 0; } }
283    
284        public double getDouble(String parameterName) throws SQLException
285        { checkOpen(); try { return ((CallableStatement)_stmt).getDouble(parameterName); } catch (SQLException e) { handleException(e); return 0; } }
286    
287        public byte[] getBytes(String parameterName) throws SQLException
288        { checkOpen(); try { return ((CallableStatement)_stmt).getBytes(parameterName); } catch (SQLException e) { handleException(e); return null; } }
289    
290        public Date getDate(String parameterName) throws SQLException
291        { checkOpen(); try { return ((CallableStatement)_stmt).getDate(parameterName); } catch (SQLException e) { handleException(e); return null; } }
292    
293        public Time getTime(String parameterName) throws SQLException
294        { checkOpen(); try { return ((CallableStatement)_stmt).getTime(parameterName); } catch (SQLException e) { handleException(e); return null; } }
295    
296        public Timestamp getTimestamp(String parameterName) throws SQLException
297        { checkOpen(); try { return ((CallableStatement)_stmt).getTimestamp(parameterName); } catch (SQLException e) { handleException(e); return null; } }
298    
299        public Object getObject(String parameterName) throws SQLException
300        { checkOpen(); try { return ((CallableStatement)_stmt).getObject(parameterName); } catch (SQLException e) { handleException(e); return null; } }
301    
302        public BigDecimal getBigDecimal(String parameterName) throws SQLException
303        { checkOpen(); try { return ((CallableStatement)_stmt).getBigDecimal(parameterName); } catch (SQLException e) { handleException(e); return null; } }
304    
305        public Object getObject(String parameterName, Map map) throws SQLException
306        { checkOpen(); try { return ((CallableStatement)_stmt).getObject(parameterName, map); } catch (SQLException e) { handleException(e); return null; } }
307    
308        public Ref getRef(String parameterName) throws SQLException
309        { checkOpen(); try { return ((CallableStatement)_stmt).getRef(parameterName); } catch (SQLException e) { handleException(e); return null; } }
310    
311        public Blob getBlob(String parameterName) throws SQLException
312        { checkOpen(); try { return ((CallableStatement)_stmt).getBlob(parameterName); } catch (SQLException e) { handleException(e); return null; } }
313    
314        public Clob getClob(String parameterName) throws SQLException
315        { checkOpen(); try { return ((CallableStatement)_stmt).getClob(parameterName); } catch (SQLException e) { handleException(e); return null; } }
316    
317        public Array getArray(String parameterName) throws SQLException
318        { checkOpen(); try { return ((CallableStatement)_stmt).getArray(parameterName); } catch (SQLException e) { handleException(e); return null; } }
319    
320        public Date getDate(String parameterName, Calendar cal) throws SQLException
321        { checkOpen(); try { return ((CallableStatement)_stmt).getDate(parameterName, cal); } catch (SQLException e) { handleException(e); return null; } }
322    
323        public Time getTime(String parameterName, Calendar cal) throws SQLException
324        { checkOpen(); try { return ((CallableStatement)_stmt).getTime(parameterName, cal); } catch (SQLException e) { handleException(e); return null; } }
325    
326        public Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException
327        { checkOpen(); try { return ((CallableStatement)_stmt).getTimestamp(parameterName, cal); } catch (SQLException e) { handleException(e); return null; } }
328    
329        public URL getURL(String parameterName) throws SQLException
330        { checkOpen(); try { return ((CallableStatement)_stmt).getURL(parameterName); } catch (SQLException e) { handleException(e); return null; } }
331    
332    /* JDBC_4_ANT_KEY_BEGIN */
333    
334        public RowId getRowId(int parameterIndex) throws SQLException {
335            checkOpen();
336            try {
337                return ((CallableStatement)_stmt).getRowId(parameterIndex);
338            }
339            catch (SQLException e) {
340                handleException(e);
341                return null;
342            }
343        }
344    
345        public RowId getRowId(String parameterName) throws SQLException {
346            checkOpen();
347            try {
348                return ((CallableStatement)_stmt).getRowId(parameterName);
349            }
350            catch (SQLException e) {
351                handleException(e);
352                return null;
353            }
354        }
355    
356        public void setRowId(String parameterName, RowId value) throws SQLException {
357            checkOpen();
358            try {
359                ((CallableStatement)_stmt).setRowId(parameterName, value);
360            }
361            catch (SQLException e) {
362                handleException(e);
363            }
364        }
365    
366        public void setNString(String parameterName, String value) throws SQLException {
367            checkOpen();
368            try {
369                ((CallableStatement)_stmt).setNString(parameterName, value);
370            }
371            catch (SQLException e) {
372                handleException(e);
373            }
374        }
375    
376        public void setNCharacterStream(String parameterName, Reader reader, long length) throws SQLException {
377            checkOpen();
378            try {
379                ((CallableStatement)_stmt).setNCharacterStream(parameterName, reader, length);
380            }
381            catch (SQLException e) {
382                handleException(e);
383            }
384        }
385    
386        public void setNClob(String parameterName, NClob value) throws SQLException {
387            checkOpen();
388            try {
389                ((CallableStatement)_stmt).setNClob(parameterName, value);
390            }
391            catch (SQLException e) {
392                handleException(e);
393            }
394        }
395    
396        public void setClob(String parameterName, Reader reader, long length) throws SQLException {
397            checkOpen();
398            try {
399                ((CallableStatement)_stmt).setClob(parameterName, reader, length);
400            }
401            catch (SQLException e) {
402                handleException(e);
403            }
404        }
405    
406        public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException {
407            checkOpen();
408            try {
409                ((CallableStatement)_stmt).setBlob(parameterName, inputStream, length);
410            }
411            catch (SQLException e) {
412                handleException(e);
413            }
414        }
415    
416        public void setNClob(String parameterName, Reader reader, long length) throws SQLException {
417            checkOpen();
418            try {
419                ((CallableStatement)_stmt).setNClob(parameterName, reader, length);
420            }
421            catch (SQLException e) {
422                handleException(e);
423            }
424        }
425    
426        public NClob getNClob(int parameterIndex) throws SQLException {
427            checkOpen();
428            try {
429                return ((CallableStatement)_stmt).getNClob(parameterIndex);
430            }
431            catch (SQLException e) {
432                handleException(e);
433                return null;
434            }
435        }
436    
437        public NClob getNClob(String parameterName) throws SQLException {
438            checkOpen();
439            try {
440                return ((CallableStatement)_stmt).getNClob(parameterName);
441            }
442            catch (SQLException e) {
443                handleException(e);
444                return null;
445            }
446        }
447    
448        public void setSQLXML(String parameterName, SQLXML value) throws SQLException {
449            checkOpen();
450            try {
451                ((CallableStatement)_stmt).setSQLXML(parameterName, value);
452            }
453            catch (SQLException e) {
454                handleException(e);
455            }
456        }
457    
458        public SQLXML getSQLXML(int parameterIndex) throws SQLException {
459            checkOpen();
460            try {
461                return ((CallableStatement)_stmt).getSQLXML(parameterIndex);
462            }
463            catch (SQLException e) {
464                handleException(e);
465                return null;
466            }
467        }
468    
469        public SQLXML getSQLXML(String parameterName) throws SQLException {
470            checkOpen();
471            try {
472                return ((CallableStatement)_stmt).getSQLXML(parameterName);
473            }
474            catch (SQLException e) {
475                handleException(e);
476                return null;
477            }
478        }
479    
480        public String getNString(int parameterIndex) throws SQLException {
481            checkOpen();
482            try {
483                return ((CallableStatement)_stmt).getNString(parameterIndex);
484            }
485            catch (SQLException e) {
486                handleException(e);
487                return null;
488            }
489        }
490    
491        public String getNString(String parameterName) throws SQLException {
492            checkOpen();
493            try {
494                return ((CallableStatement)_stmt).getNString(parameterName);
495            }
496            catch (SQLException e) {
497                handleException(e);
498                return null;
499            }
500        }
501    
502        public Reader getNCharacterStream(int parameterIndex) throws SQLException {
503            checkOpen();
504            try {
505                return ((CallableStatement)_stmt).getNCharacterStream(parameterIndex);
506            }
507            catch (SQLException e) {
508                handleException(e);
509                return null;
510            }
511        }
512    
513        public Reader getNCharacterStream(String parameterName) throws SQLException {
514            checkOpen();
515            try {
516                return ((CallableStatement)_stmt).getNCharacterStream(parameterName);
517            }
518            catch (SQLException e) {
519                handleException(e);
520                return null;
521            }
522        }
523    
524        public Reader getCharacterStream(int parameterIndex) throws SQLException {
525            checkOpen();
526            try {
527                return ((CallableStatement)_stmt).getCharacterStream(parameterIndex);
528            }
529            catch (SQLException e) {
530                handleException(e);
531                return null;
532            }
533        }
534    
535        public Reader getCharacterStream(String parameterName) throws SQLException {
536            checkOpen();
537            try {
538                return ((CallableStatement)_stmt).getCharacterStream(parameterName);
539            }
540            catch (SQLException e) {
541                handleException(e);
542                return null;
543            }
544        }
545    
546        public void setBlob(String parameterName, Blob blob) throws SQLException {
547            checkOpen();
548            try {
549                ((CallableStatement)_stmt).setBlob(parameterName, blob);
550            }
551            catch (SQLException e) {
552                handleException(e);
553            }
554        }
555    
556        public void setClob(String parameterName, Clob clob) throws SQLException {
557            checkOpen();
558            try {
559                ((CallableStatement)_stmt).setClob(parameterName, clob);
560            }
561            catch (SQLException e) {
562                handleException(e);
563            }
564        }
565    
566        public void setAsciiStream(String parameterName, InputStream inputStream, long length) throws SQLException {
567            checkOpen();
568            try {
569                ((CallableStatement)_stmt).setAsciiStream(parameterName, inputStream, length);
570            }
571            catch (SQLException e) {
572                handleException(e);
573            }
574        }
575    
576        public void setBinaryStream(String parameterName, InputStream inputStream, long length) throws SQLException {
577            checkOpen();
578            try {
579                ((CallableStatement)_stmt).setBinaryStream(parameterName, inputStream, length);
580            }
581            catch (SQLException e) {
582                handleException(e);
583            }
584        }
585    
586        public void setCharacterStream(String parameterName, Reader reader, long length) throws SQLException {
587            checkOpen();
588            try {
589                ((CallableStatement)_stmt).setCharacterStream(parameterName, reader, length);
590            }
591            catch (SQLException e) {
592                handleException(e);
593            }
594        }
595    
596        public void setAsciiStream(String parameterName, InputStream inputStream) throws SQLException {
597            checkOpen();
598            try {
599                ((CallableStatement)_stmt).setAsciiStream(parameterName, inputStream);
600            }
601            catch (SQLException e) {
602                handleException(e);
603            }
604        }
605    
606        public void setBinaryStream(String parameterName, InputStream inputStream) throws SQLException {
607            checkOpen();
608            try {
609                ((CallableStatement)_stmt).setBinaryStream(parameterName, inputStream);
610            }
611            catch (SQLException e) {
612                handleException(e);
613            }
614        }
615    
616        public void setCharacterStream(String parameterName, Reader reader) throws SQLException {
617            checkOpen();
618            try {
619                ((CallableStatement)_stmt).setCharacterStream(parameterName, reader);
620            }
621            catch (SQLException e) {
622                handleException(e);
623            }
624        }
625    
626        public void setNCharacterStream(String parameterName, Reader reader) throws SQLException {
627            checkOpen();
628            try {
629                ((CallableStatement)_stmt).setNCharacterStream(parameterName, reader);
630            }
631            catch (SQLException e) {
632                handleException(e);
633            }
634        }
635    
636        public void setClob(String parameterName, Reader reader) throws SQLException {
637            checkOpen();
638            try {
639                ((CallableStatement)_stmt).setClob(parameterName, reader);
640            }
641            catch (SQLException e) {
642                handleException(e);
643            }    }
644    
645        public void setBlob(String parameterName, InputStream inputStream) throws SQLException {
646            checkOpen();
647            try {
648                ((CallableStatement)_stmt).setBlob(parameterName, inputStream);
649            }
650            catch (SQLException e) {
651                handleException(e);
652            }    }
653    
654        public void setNClob(String parameterName, Reader reader) throws SQLException {
655            checkOpen();
656            try {
657                ((CallableStatement)_stmt).setNClob(parameterName, reader);
658            }
659            catch (SQLException e) {
660                handleException(e);
661            }
662        }
663    /* JDBC_4_ANT_KEY_END */
664    }