View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.commons.dbcp;
19  
20  import java.net.URL;
21  import java.sql.CallableStatement;
22  import java.math.BigDecimal;
23  import java.sql.Date;
24  import java.sql.Time;
25  import java.sql.Timestamp;
26  import java.util.Map;
27  import java.sql.Ref;
28  import java.sql.Blob;
29  import java.sql.Clob;
30  import java.sql.Array;
31  import java.util.Calendar;
32  import java.io.InputStream;
33  import java.io.Reader;
34  import java.sql.SQLException;
35  /* JDBC_4_ANT_KEY_BEGIN */
36  import java.sql.NClob;
37  import java.sql.RowId;
38  import java.sql.SQLXML;
39  /* JDBC_4_ANT_KEY_END */
40  
41  /**
42   * A base delegating implementation of {@link CallableStatement}.
43   * <p>
44   * All of the methods from the {@link CallableStatement} interface
45   * simply call the corresponding method on the "delegate"
46   * provided in my constructor.
47   * <p>
48   * Extends AbandonedTrace to implement Statement tracking and
49   * logging of code which created the Statement. Tracking the
50   * Statement ensures that the Connection which created it can
51   * close any open Statement's on Connection close.
52   *
53   * @author Glenn L. Nielsen
54   * @author James House
55   * @author Dirk Verbeeck
56   * @version $Revision: 745698 $ $Date: 2009-02-18 19:28:26 -0500 (Wed, 18 Feb 2009) $
57   */
58  public class DelegatingCallableStatement extends DelegatingPreparedStatement
59          implements CallableStatement {
60  
61      /**
62       * Create a wrapper for the Statement which traces this
63       * Statement to the Connection which created it and the
64       * code which created it.
65       *
66       * @param c the {@link DelegatingConnection} that created this statement
67       * @param s the {@link CallableStatement} to delegate all calls to
68       */
69      public DelegatingCallableStatement(DelegatingConnection c,
70                                         CallableStatement s) {
71          super(c, s);
72      }
73  
74      public boolean equals(Object obj) {
75          CallableStatement delegate = (CallableStatement) getInnermostDelegate();
76          if (delegate == null) {
77              return false;
78          }
79          if (obj instanceof DelegatingCallableStatement) {
80              DelegatingCallableStatement s = (DelegatingCallableStatement) obj;
81              return delegate.equals(s.getInnermostDelegate());
82          }
83          else {
84              return delegate.equals(obj);
85          }
86      }
87  
88      /** Sets my delegate. */
89      public void setDelegate(CallableStatement s) {
90          super.setDelegate(s);
91          _stmt = s;
92      }
93  
94      public void registerOutParameter(int parameterIndex, int sqlType) throws SQLException
95      { checkOpen(); try { ((CallableStatement)_stmt).registerOutParameter( parameterIndex,  sqlType); } catch (SQLException e) { handleException(e); } }
96  
97      public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws SQLException
98      { checkOpen(); try { ((CallableStatement)_stmt).registerOutParameter( parameterIndex,  sqlType,  scale); } catch (SQLException e) { handleException(e); } }
99  
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     // ------------------- JDBC 3.0 -----------------------------------------
177     // Will be commented by the build process on a JDBC 2.0 system
178 
179 /* JDBC_3_ANT_KEY_BEGIN */
180 
181     public void registerOutParameter(String parameterName, int sqlType) throws SQLException
182     { checkOpen(); try { ((CallableStatement)_stmt).registerOutParameter(parameterName, sqlType); } catch (SQLException e) { handleException(e); } }
183 
184     public void registerOutParameter(String parameterName, int sqlType, int scale) throws SQLException
185     { checkOpen(); try { ((CallableStatement)_stmt).registerOutParameter(parameterName, sqlType, scale); } catch (SQLException e) { handleException(e); } }
186 
187     public void registerOutParameter(String parameterName, int sqlType, String typeName) throws SQLException
188     { checkOpen(); try { ((CallableStatement)_stmt).registerOutParameter(parameterName, sqlType, typeName); } catch (SQLException e) { handleException(e); } }
189 
190     public URL getURL(int parameterIndex) throws SQLException
191     { checkOpen(); try { return ((CallableStatement)_stmt).getURL(parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
192 
193     public void setURL(String parameterName, URL val) throws SQLException
194     { checkOpen(); try { ((CallableStatement)_stmt).setURL(parameterName, val); } catch (SQLException e) { handleException(e); } }
195 
196     public void setNull(String parameterName, int sqlType) throws SQLException
197     { checkOpen(); try { ((CallableStatement)_stmt).setNull(parameterName, sqlType); } catch (SQLException e) { handleException(e); } }
198 
199     public void setBoolean(String parameterName, boolean x) throws SQLException
200     { checkOpen(); try { ((CallableStatement)_stmt).setBoolean(parameterName, x); } catch (SQLException e) { handleException(e); } }
201 
202     public void setByte(String parameterName, byte x) throws SQLException
203     { checkOpen(); try { ((CallableStatement)_stmt).setByte(parameterName, x); } catch (SQLException e) { handleException(e); } }
204 
205     public void setShort(String parameterName, short x) throws SQLException
206     { checkOpen(); try { ((CallableStatement)_stmt).setShort(parameterName, x); } catch (SQLException e) { handleException(e); } }
207 
208     public void setInt(String parameterName, int x) throws SQLException
209     { checkOpen(); try { ((CallableStatement)_stmt).setInt(parameterName, x); } catch (SQLException e) { handleException(e); } }
210 
211     public void setLong(String parameterName, long x) throws SQLException
212     { checkOpen(); try { ((CallableStatement)_stmt).setLong(parameterName, x); } catch (SQLException e) { handleException(e); } }
213 
214     public void setFloat(String parameterName, float x) throws SQLException
215     { checkOpen(); try { ((CallableStatement)_stmt).setFloat(parameterName, x); } catch (SQLException e) { handleException(e); } }
216 
217     public void setDouble(String parameterName, double x) throws SQLException
218     { checkOpen(); try { ((CallableStatement)_stmt).setDouble(parameterName, x); } catch (SQLException e) { handleException(e); } }
219 
220     public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException
221     { checkOpen(); try { ((CallableStatement)_stmt).setBigDecimal(parameterName, x); } catch (SQLException e) { handleException(e); } }
222 
223     public void setString(String parameterName, String x) throws SQLException
224     { checkOpen(); try { ((CallableStatement)_stmt).setString(parameterName, x); } catch (SQLException e) { handleException(e); } }
225 
226     public void setBytes(String parameterName, byte [] x) throws SQLException
227     { checkOpen(); try { ((CallableStatement)_stmt).setBytes(parameterName, x); } catch (SQLException e) { handleException(e); } }
228 
229     public void setDate(String parameterName, Date x) throws SQLException
230     { checkOpen(); try { ((CallableStatement)_stmt).setDate(parameterName, x); } catch (SQLException e) { handleException(e); } }
231 
232     public void setTime(String parameterName, Time x) throws SQLException
233     { checkOpen(); try { ((CallableStatement)_stmt).setTime(parameterName, x); } catch (SQLException e) { handleException(e); } }
234 
235     public void setTimestamp(String parameterName, Timestamp x) throws SQLException
236     { checkOpen(); try { ((CallableStatement)_stmt).setTimestamp(parameterName, x); } catch (SQLException e) { handleException(e); } }
237 
238     public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException
239     { checkOpen(); try { ((CallableStatement)_stmt).setAsciiStream(parameterName, x, length); } catch (SQLException e) { handleException(e); } }
240 
241     public void setBinaryStream(String parameterName, InputStream x, int length) throws SQLException
242     { checkOpen(); try { ((CallableStatement)_stmt).setBinaryStream(parameterName, x, length); } catch (SQLException e) { handleException(e); } }
243 
244     public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException
245     { checkOpen(); try { ((CallableStatement)_stmt).setObject(parameterName, x, targetSqlType, scale); } catch (SQLException e) { handleException(e); } }
246 
247     public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException
248     { checkOpen(); try { ((CallableStatement)_stmt).setObject(parameterName, x, targetSqlType); } catch (SQLException e) { handleException(e); } }
249 
250     public void setObject(String parameterName, Object x) throws SQLException
251     { checkOpen(); try { ((CallableStatement)_stmt).setObject(parameterName, x); } catch (SQLException e) { handleException(e); } }
252 
253     public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException
254     { checkOpen(); ((CallableStatement)_stmt).setCharacterStream(parameterName, reader, length); }
255 
256     public void setDate(String parameterName, Date x, Calendar cal) throws SQLException
257     { checkOpen(); try { ((CallableStatement)_stmt).setDate(parameterName, x, cal); } catch (SQLException e) { handleException(e); } }
258 
259     public void setTime(String parameterName, Time x, Calendar cal) throws SQLException
260     { checkOpen(); try { ((CallableStatement)_stmt).setTime(parameterName, x, cal); } catch (SQLException e) { handleException(e); } }
261 
262     public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException
263     { checkOpen(); try { ((CallableStatement)_stmt).setTimestamp(parameterName, x, cal); } catch (SQLException e) { handleException(e); } }
264 
265     public void setNull(String parameterName, int sqlType, String typeName) throws SQLException
266     { checkOpen(); try { ((CallableStatement)_stmt).setNull(parameterName, sqlType, typeName); } catch (SQLException e) { handleException(e); } }
267 
268     public String getString(String parameterName) throws SQLException
269     { checkOpen(); try { return ((CallableStatement)_stmt).getString(parameterName); } catch (SQLException e) { handleException(e); return null; } }
270 
271     public boolean getBoolean(String parameterName) throws SQLException
272     { checkOpen(); try { return ((CallableStatement)_stmt).getBoolean(parameterName); } catch (SQLException e) { handleException(e); return false; } }
273 
274     public byte getByte(String parameterName) throws SQLException
275     { checkOpen(); try { return ((CallableStatement)_stmt).getByte(parameterName); } catch (SQLException e) { handleException(e); return 0; } }
276 
277     public short getShort(String parameterName) throws SQLException
278     { checkOpen(); try { return ((CallableStatement)_stmt).getShort(parameterName); } catch (SQLException e) { handleException(e); return 0; } }
279 
280     public int getInt(String parameterName) throws SQLException
281     { checkOpen(); try { return ((CallableStatement)_stmt).getInt(parameterName); } catch (SQLException e) { handleException(e); return 0; } }
282 
283     public long getLong(String parameterName) throws SQLException
284     { checkOpen(); try { return ((CallableStatement)_stmt).getLong(parameterName); } catch (SQLException e) { handleException(e); return 0; } }
285 
286     public float getFloat(String parameterName) throws SQLException
287     { checkOpen(); try { return ((CallableStatement)_stmt).getFloat(parameterName); } catch (SQLException e) { handleException(e); return 0; } }
288 
289     public double getDouble(String parameterName) throws SQLException
290     { checkOpen(); try { return ((CallableStatement)_stmt).getDouble(parameterName); } catch (SQLException e) { handleException(e); return 0; } }
291 
292     public byte[] getBytes(String parameterName) throws SQLException
293     { checkOpen(); try { return ((CallableStatement)_stmt).getBytes(parameterName); } catch (SQLException e) { handleException(e); return null; } }
294 
295     public Date getDate(String parameterName) throws SQLException
296     { checkOpen(); try { return ((CallableStatement)_stmt).getDate(parameterName); } catch (SQLException e) { handleException(e); return null; } }
297 
298     public Time getTime(String parameterName) throws SQLException
299     { checkOpen(); try { return ((CallableStatement)_stmt).getTime(parameterName); } catch (SQLException e) { handleException(e); return null; } }
300 
301     public Timestamp getTimestamp(String parameterName) throws SQLException
302     { checkOpen(); try { return ((CallableStatement)_stmt).getTimestamp(parameterName); } catch (SQLException e) { handleException(e); return null; } }
303 
304     public Object getObject(String parameterName) throws SQLException
305     { checkOpen(); try { return ((CallableStatement)_stmt).getObject(parameterName); } catch (SQLException e) { handleException(e); return null; } }
306 
307     public BigDecimal getBigDecimal(String parameterName) throws SQLException
308     { checkOpen(); try { return ((CallableStatement)_stmt).getBigDecimal(parameterName); } catch (SQLException e) { handleException(e); return null; } }
309 
310     public Object getObject(String parameterName, Map map) throws SQLException
311     { checkOpen(); try { return ((CallableStatement)_stmt).getObject(parameterName, map); } catch (SQLException e) { handleException(e); return null; } }
312 
313     public Ref getRef(String parameterName) throws SQLException
314     { checkOpen(); try { return ((CallableStatement)_stmt).getRef(parameterName); } catch (SQLException e) { handleException(e); return null; } }
315 
316     public Blob getBlob(String parameterName) throws SQLException
317     { checkOpen(); try { return ((CallableStatement)_stmt).getBlob(parameterName); } catch (SQLException e) { handleException(e); return null; } }
318 
319     public Clob getClob(String parameterName) throws SQLException
320     { checkOpen(); try { return ((CallableStatement)_stmt).getClob(parameterName); } catch (SQLException e) { handleException(e); return null; } }
321 
322     public Array getArray(String parameterName) throws SQLException
323     { checkOpen(); try { return ((CallableStatement)_stmt).getArray(parameterName); } catch (SQLException e) { handleException(e); return null; } }
324 
325     public Date getDate(String parameterName, Calendar cal) throws SQLException
326     { checkOpen(); try { return ((CallableStatement)_stmt).getDate(parameterName, cal); } catch (SQLException e) { handleException(e); return null; } }
327 
328     public Time getTime(String parameterName, Calendar cal) throws SQLException
329     { checkOpen(); try { return ((CallableStatement)_stmt).getTime(parameterName, cal); } catch (SQLException e) { handleException(e); return null; } }
330 
331     public Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException
332     { checkOpen(); try { return ((CallableStatement)_stmt).getTimestamp(parameterName, cal); } catch (SQLException e) { handleException(e); return null; } }
333 
334     public URL getURL(String parameterName) throws SQLException
335     { checkOpen(); try { return ((CallableStatement)_stmt).getURL(parameterName); } catch (SQLException e) { handleException(e); return null; } }
336 /* JDBC_3_ANT_KEY_END */
337 /* JDBC_4_ANT_KEY_BEGIN */
338 
339     public RowId getRowId(int parameterIndex) throws SQLException {
340         checkOpen();
341         try {
342             return ((CallableStatement)_stmt).getRowId(parameterIndex);
343         }
344         catch (SQLException e) {
345             handleException(e);
346             return null;
347         }
348     }
349 
350     public RowId getRowId(String parameterName) throws SQLException {
351         checkOpen();
352         try {
353             return ((CallableStatement)_stmt).getRowId(parameterName);
354         }
355         catch (SQLException e) {
356             handleException(e);
357             return null;
358         }
359     }
360 
361     public void setRowId(String parameterName, RowId value) throws SQLException {
362         checkOpen();
363         try {
364             ((CallableStatement)_stmt).setRowId(parameterName, value);
365         }
366         catch (SQLException e) {
367             handleException(e);
368         }
369     }
370 
371     public void setNString(String parameterName, String value) throws SQLException {
372         checkOpen();
373         try {
374             ((CallableStatement)_stmt).setNString(parameterName, value);
375         }
376         catch (SQLException e) {
377             handleException(e);
378         }
379     }
380 
381     public void setNCharacterStream(String parameterName, Reader reader, long length) throws SQLException {
382         checkOpen();
383         try {
384             ((CallableStatement)_stmt).setNCharacterStream(parameterName, reader, length);
385         }
386         catch (SQLException e) {
387             handleException(e);
388         }
389     }
390 
391     public void setNClob(String parameterName, NClob value) throws SQLException {
392         checkOpen();
393         try {
394             ((CallableStatement)_stmt).setNClob(parameterName, value);
395         }
396         catch (SQLException e) {
397             handleException(e);
398         }
399     }
400 
401     public void setClob(String parameterName, Reader reader, long length) throws SQLException {
402         checkOpen();
403         try {
404             ((CallableStatement)_stmt).setClob(parameterName, reader, length);
405         }
406         catch (SQLException e) {
407             handleException(e);
408         }
409     }
410 
411     public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException {
412         checkOpen();
413         try {
414             ((CallableStatement)_stmt).setBlob(parameterName, inputStream, length);
415         }
416         catch (SQLException e) {
417             handleException(e);
418         }
419     }
420 
421     public void setNClob(String parameterName, Reader reader, long length) throws SQLException {
422         checkOpen();
423         try {
424             ((CallableStatement)_stmt).setNClob(parameterName, reader, length);
425         }
426         catch (SQLException e) {
427             handleException(e);
428         }
429     }
430 
431     public NClob getNClob(int parameterIndex) throws SQLException {
432         checkOpen();
433         try {
434             return ((CallableStatement)_stmt).getNClob(parameterIndex);
435         }
436         catch (SQLException e) {
437             handleException(e);
438             return null;
439         }
440     }
441 
442     public NClob getNClob(String parameterName) throws SQLException {
443         checkOpen();
444         try {
445             return ((CallableStatement)_stmt).getNClob(parameterName);
446         }
447         catch (SQLException e) {
448             handleException(e);
449             return null;
450         }
451     }
452 
453     public void setSQLXML(String parameterName, SQLXML value) throws SQLException {
454         checkOpen();
455         try {
456             ((CallableStatement)_stmt).setSQLXML(parameterName, value);
457         }
458         catch (SQLException e) {
459             handleException(e);
460         }
461     }
462 
463     public SQLXML getSQLXML(int parameterIndex) throws SQLException {
464         checkOpen();
465         try {
466             return ((CallableStatement)_stmt).getSQLXML(parameterIndex);
467         }
468         catch (SQLException e) {
469             handleException(e);
470             return null;
471         }
472     }
473 
474     public SQLXML getSQLXML(String parameterName) throws SQLException {
475         checkOpen();
476         try {
477             return ((CallableStatement)_stmt).getSQLXML(parameterName);
478         }
479         catch (SQLException e) {
480             handleException(e);
481             return null;
482         }
483     }
484 
485     public String getNString(int parameterIndex) throws SQLException {
486         checkOpen();
487         try {
488             return ((CallableStatement)_stmt).getNString(parameterIndex);
489         }
490         catch (SQLException e) {
491             handleException(e);
492             return null;
493         }
494     }
495 
496     public String getNString(String parameterName) throws SQLException {
497         checkOpen();
498         try {
499             return ((CallableStatement)_stmt).getNString(parameterName);
500         }
501         catch (SQLException e) {
502             handleException(e);
503             return null;
504         }
505     }
506 
507     public Reader getNCharacterStream(int parameterIndex) throws SQLException {
508         checkOpen();
509         try {
510             return ((CallableStatement)_stmt).getNCharacterStream(parameterIndex);
511         }
512         catch (SQLException e) {
513             handleException(e);
514             return null;
515         }
516     }
517 
518     public Reader getNCharacterStream(String parameterName) throws SQLException {
519         checkOpen();
520         try {
521             return ((CallableStatement)_stmt).getNCharacterStream(parameterName);
522         }
523         catch (SQLException e) {
524             handleException(e);
525             return null;
526         }
527     }
528 
529     public Reader getCharacterStream(int parameterIndex) throws SQLException {
530         checkOpen();
531         try {
532             return ((CallableStatement)_stmt).getCharacterStream(parameterIndex);
533         }
534         catch (SQLException e) {
535             handleException(e);
536             return null;
537         }
538     }
539 
540     public Reader getCharacterStream(String parameterName) throws SQLException {
541         checkOpen();
542         try {
543             return ((CallableStatement)_stmt).getCharacterStream(parameterName);
544         }
545         catch (SQLException e) {
546             handleException(e);
547             return null;
548         }
549     }
550 
551     public void setBlob(String parameterName, Blob blob) throws SQLException {
552         checkOpen();
553         try {
554             ((CallableStatement)_stmt).setBlob(parameterName, blob);
555         }
556         catch (SQLException e) {
557             handleException(e);
558         }
559     }
560 
561     public void setClob(String parameterName, Clob clob) throws SQLException {
562         checkOpen();
563         try {
564             ((CallableStatement)_stmt).setClob(parameterName, clob);
565         }
566         catch (SQLException e) {
567             handleException(e);
568         }
569     }
570 
571     public void setAsciiStream(String parameterName, InputStream inputStream, long length) throws SQLException {
572         checkOpen();
573         try {
574             ((CallableStatement)_stmt).setAsciiStream(parameterName, inputStream, length);
575         }
576         catch (SQLException e) {
577             handleException(e);
578         }
579     }
580 
581     public void setBinaryStream(String parameterName, InputStream inputStream, long length) throws SQLException {
582         checkOpen();
583         try {
584             ((CallableStatement)_stmt).setBinaryStream(parameterName, inputStream, length);
585         }
586         catch (SQLException e) {
587             handleException(e);
588         }
589     }
590 
591     public void setCharacterStream(String parameterName, Reader reader, long length) throws SQLException {
592         checkOpen();
593         try {
594             ((CallableStatement)_stmt).setCharacterStream(parameterName, reader, length);
595         }
596         catch (SQLException e) {
597             handleException(e);
598         }
599     }
600 
601     public void setAsciiStream(String parameterName, InputStream inputStream) throws SQLException {
602         checkOpen();
603         try {
604             ((CallableStatement)_stmt).setAsciiStream(parameterName, inputStream);
605         }
606         catch (SQLException e) {
607             handleException(e);
608         }
609     }
610 
611     public void setBinaryStream(String parameterName, InputStream inputStream) throws SQLException {
612         checkOpen();
613         try {
614             ((CallableStatement)_stmt).setBinaryStream(parameterName, inputStream);
615         }
616         catch (SQLException e) {
617             handleException(e);
618         }
619     }
620 
621     public void setCharacterStream(String parameterName, Reader reader) throws SQLException {
622         checkOpen();
623         try {
624             ((CallableStatement)_stmt).setCharacterStream(parameterName, reader);
625         }
626         catch (SQLException e) {
627             handleException(e);
628         }
629     }
630 
631     public void setNCharacterStream(String parameterName, Reader reader) throws SQLException {
632         checkOpen();
633         try {
634             ((CallableStatement)_stmt).setNCharacterStream(parameterName, reader);
635         }
636         catch (SQLException e) {
637             handleException(e);
638         }
639     }
640 
641     public void setClob(String parameterName, Reader reader) throws SQLException {
642         checkOpen();
643         try {
644             ((CallableStatement)_stmt).setClob(parameterName, reader);
645         }
646         catch (SQLException e) {
647             handleException(e);
648         }    }
649 
650     public void setBlob(String parameterName, InputStream inputStream) throws SQLException {
651         checkOpen();
652         try {
653             ((CallableStatement)_stmt).setBlob(parameterName, inputStream);
654         }
655         catch (SQLException e) {
656             handleException(e);
657         }    }
658 
659     public void setNClob(String parameterName, Reader reader) throws SQLException {
660         checkOpen();
661         try {
662             ((CallableStatement)_stmt).setNClob(parameterName, reader);
663         }
664         catch (SQLException e) {
665             handleException(e);
666         }
667     }
668 /* JDBC_4_ANT_KEY_END */
669 }