View Javadoc

1   /*
2    * $Source: /usr/cvsroot/melati/throwing-jdbc/src/main/java/org/melati/poem/dbms/test/sql/ThrowingPreparedStatementJdbc3.java,v $
3    * $Revision: 1.4 $
4    *
5    * Copyright (C) 2008 Tim Pizey
6    *
7    * Part of Melati (http://melati.org), a framework for the rapid
8    * development of clean, maintainable web applications.
9    *
10   * Melati is free software; Permission is granted to copy, distribute
11   * and/or modify this software under the terms either:
12   *
13   * a) the GNU General Public License as published by the Free Software
14   *    Foundation; either version 2 of the License, or (at your option)
15   *    any later version,
16   *
17   *    or
18   *
19   * b) any version of the Melati Software License, as published
20   *    at http://melati.org
21   *
22   * You should have received a copy of the GNU General Public License and
23   * the Melati Software License along with this program;
24   * if not, write to the Free Software Foundation, Inc.,
25   * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA to obtain the
26   * GNU General Public License and visit http://melati.org to obtain the
27   * Melati Software License.
28   *
29   * Feel free to contact the Developers of Melati (http://melati.org),
30   * if you would like to work out a different arrangement than the options
31   * outlined here.  It is our intention to allow Melati to be used by as
32   * wide an audience as possible.
33   *
34   * This program is distributed in the hope that it will be useful,
35   * but WITHOUT ANY WARRANTY; without even the implied warranty of
36   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
37   * GNU General Public License for more details.
38   *
39   * Contact details for copyright holder:
40   *
41   *     Tim Pizey <timp At paneris.org>
42   *     http://paneris.org/~timp
43   */
44  
45  package org.melati.poem.dbms.test.sql;
46  
47  import java.io.InputStream;
48  import java.io.Reader;
49  import java.math.BigDecimal;
50  import java.net.URL;
51  import java.sql.Array;
52  import java.sql.Blob;
53  import java.sql.Clob;
54  import java.sql.Connection;
55  import java.sql.Date;
56  import java.sql.ParameterMetaData;
57  import java.sql.PreparedStatement;
58  import java.sql.Ref;
59  import java.sql.ResultSet;
60  import java.sql.ResultSetMetaData;
61  import java.sql.SQLException;
62  import java.sql.SQLWarning;
63  import java.sql.Time;
64  import java.sql.Timestamp;
65  import java.util.Calendar;
66  
67  /**
68   * The JDBC3 members of a {@link PreparedStatement}, decorated to throw an SQLException on command.
69   * 
70   * @author timp
71   * @since  5 Feb 2008
72   *
73   */
74  public abstract class ThrowingPreparedStatementJdbc3 
75      extends Thrower 
76      implements PreparedStatement {
77  
78    PreparedStatement it = null;
79    /**
80     * {@inheritDoc}
81     * 
82     * @see java.sql.PreparedStatement#addBatch()
83     */
84    public void addBatch() throws SQLException {
85      if (shouldThrow(this.getClass().getInterfaces()[0], "addBatch"))
86        throw new SQLException("PreparedStatement bombed");
87      it.addBatch();
88    }
89  
90    /**
91     * {@inheritDoc}
92     * 
93     * @see java.sql.PreparedStatement#clearParameters()
94     */
95    public void clearParameters() throws SQLException {
96      if (shouldThrow(this.getClass().getInterfaces()[0], "clearParameters"))
97        throw new SQLException("PreparedStatement bombed");
98      it.clearParameters();
99    }
100 
101   /**
102    * {@inheritDoc}
103    * 
104    * @see java.sql.PreparedStatement#execute()
105    */
106   public boolean execute() throws SQLException {
107     if (shouldThrow(this.getClass().getInterfaces()[0], "execute"))
108       throw new SQLException("PreparedStatement bombed");
109 
110     return it.execute();
111   }
112 
113   /**
114    * {@inheritDoc}
115    * 
116    * @see java.sql.PreparedStatement#executeQuery()
117    */
118   public ResultSet executeQuery() throws SQLException {
119     if (shouldThrow(this.getClass().getInterfaces()[0], "executeQuery"))
120       throw new SQLException("PreparedStatement bombed");
121 
122     return new ThrowingResultSet(it.executeQuery());
123   }
124 
125   /**
126    * {@inheritDoc}
127    * 
128    * @see java.sql.PreparedStatement#executeUpdate()
129    */
130   public int executeUpdate() throws SQLException {
131     if (shouldThrow(this.getClass().getInterfaces()[0], "executeUpdate"))
132       throw new SQLException("PreparedStatement bombed");
133 
134     return it.executeUpdate();
135   }
136 
137   /**
138    * {@inheritDoc}
139    * 
140    * @see java.sql.PreparedStatement#getMetaData()
141    */
142   public ResultSetMetaData getMetaData() throws SQLException {
143     if (shouldThrow(this.getClass().getInterfaces()[0], "getMetaData"))
144       throw new SQLException("PreparedStatement bombed");
145 
146     return new ThrowingResultSetMetaData(it.getMetaData());
147   }
148 
149   /**
150    * {@inheritDoc}
151    * 
152    * @see java.sql.PreparedStatement#getParameterMetaData()
153    */
154   public ParameterMetaData getParameterMetaData() throws SQLException {
155     if (shouldThrow(this.getClass().getInterfaces()[0], "getParameterMetaData"))
156       throw new SQLException("PreparedStatement bombed");
157 
158     return new ThrowingParameterMetaData(it.getParameterMetaData());
159   }
160 
161   /**
162    * {@inheritDoc}
163    * 
164    * @see java.sql.PreparedStatement#setArray(int, java.sql.Array)
165    */
166   public void setArray(int i, Array x) throws SQLException {
167     if (shouldThrow(this.getClass().getInterfaces()[0], "setArray"))
168       throw new SQLException("PreparedStatement bombed");
169     it.setArray(i, x);
170   }
171 
172   /**
173    * {@inheritDoc}
174    * 
175    * @see java.sql.PreparedStatement#setAsciiStream(int, java.io.InputStream,
176    *      int)
177    */
178   public void setAsciiStream(int parameterIndex, InputStream x, int length)
179       throws SQLException {
180     if (shouldThrow(this.getClass().getInterfaces()[0], "setAsciiStream"))
181       throw new SQLException("PreparedStatement bombed");
182     it.setAsciiStream(parameterIndex, x, length);
183   }
184 
185   /**
186    * {@inheritDoc}
187    * 
188    * @see java.sql.PreparedStatement#setBigDecimal(int, java.math.BigDecimal)
189    */
190   public void setBigDecimal(int parameterIndex, BigDecimal x)
191       throws SQLException {
192     if (shouldThrow(this.getClass().getInterfaces()[0], "setBigDecimal"))
193       throw new SQLException("PreparedStatement bombed");
194     it.setBigDecimal(parameterIndex, x);
195   }
196 
197   /**
198    * {@inheritDoc}
199    * 
200    * @see java.sql.PreparedStatement#setBinaryStream(int, java.io.InputStream,
201    *      int)
202    */
203   public void setBinaryStream(int parameterIndex, InputStream x, int length)
204       throws SQLException {
205     if (shouldThrow(this.getClass().getInterfaces()[0], "setBinaryStream"))
206       throw new SQLException("PreparedStatement bombed");
207     it.setBinaryStream(parameterIndex, x, length);
208   }
209 
210   /**
211    * {@inheritDoc}
212    * 
213    * @see java.sql.PreparedStatement#setBlob(int, java.sql.Blob)
214    */
215   public void setBlob(int i, Blob x) throws SQLException {
216     if (shouldThrow(this.getClass().getInterfaces()[0], "setBlob"))
217       throw new SQLException("PreparedStatement bombed");
218     it.setBlob(i, x);
219   }
220 
221   /**
222    * {@inheritDoc}
223    * 
224    * @see java.sql.PreparedStatement#setBoolean(int, boolean)
225    */
226   public void setBoolean(int parameterIndex, boolean x) throws SQLException {
227     if (shouldThrow(this.getClass().getInterfaces()[0], "setBoolean"))
228       throw new SQLException("PreparedStatement bombed");
229     it.setBoolean(parameterIndex, x);
230   }
231 
232   /**
233    * {@inheritDoc}
234    * 
235    * @see java.sql.PreparedStatement#setByte(int, byte)
236    */
237   public void setByte(int parameterIndex, byte x) throws SQLException {
238     if (shouldThrow(this.getClass().getInterfaces()[0], "setByte"))
239       throw new SQLException("PreparedStatement bombed");
240     it.setByte(parameterIndex, x);
241   }
242 
243   /**
244    * {@inheritDoc}
245    * 
246    * @see java.sql.PreparedStatement#setBytes(int, byte[])
247    */
248   public void setBytes(int parameterIndex, byte[] x) throws SQLException {
249     if (shouldThrow(this.getClass().getInterfaces()[0], "setBytes"))
250       throw new SQLException("PreparedStatement bombed");
251     it.setBytes(parameterIndex, x);
252   }
253 
254   /**
255    * {@inheritDoc}
256    * 
257    * @see java.sql.PreparedStatement#setCharacterStream(int, java.io.Reader,
258    *      int)
259    */
260   public void setCharacterStream(int parameterIndex, Reader reader, int length)
261       throws SQLException {
262     if (shouldThrow(this.getClass().getInterfaces()[0], "setCharacterStream"))
263       throw new SQLException("PreparedStatement bombed");
264     it.setCharacterStream(parameterIndex, reader, length);
265   }
266 
267   /**
268    * {@inheritDoc}
269    * 
270    * @see java.sql.PreparedStatement#setClob(int, java.sql.Clob)
271    */
272   public void setClob(int i, Clob x) throws SQLException {
273     if (shouldThrow(this.getClass().getInterfaces()[0], "setClob"))
274       throw new SQLException("PreparedStatement bombed");
275     it.setClob(i, x);
276   }
277 
278   /**
279    * {@inheritDoc}
280    * 
281    * @see java.sql.PreparedStatement#setDate(int, java.sql.Date)
282    */
283   public void setDate(int parameterIndex, Date x) throws SQLException {
284     if (shouldThrow(this.getClass().getInterfaces()[0], "setDate"))
285       throw new SQLException("PreparedStatement bombed");
286     it.setDate(parameterIndex, x);
287   }
288 
289   /**
290    * {@inheritDoc}
291    * 
292    * @see java.sql.PreparedStatement#setDate(int, java.sql.Date,
293    *      java.util.Calendar)
294    */
295   public void setDate(int parameterIndex, Date x, Calendar cal)
296       throws SQLException {
297     if (shouldThrow(this.getClass().getInterfaces()[0], "setDate"))
298       throw new SQLException("PreparedStatement bombed");
299     it.setDate(parameterIndex, x, cal);
300   }
301 
302   /**
303    * {@inheritDoc}
304    * 
305    * @see java.sql.PreparedStatement#setDouble(int, double)
306    */
307   public void setDouble(int parameterIndex, double x) throws SQLException {
308     if (shouldThrow(this.getClass().getInterfaces()[0], "setDouble"))
309       throw new SQLException("PreparedStatement bombed");
310     it.setDouble(parameterIndex, x);
311   }
312 
313   /**
314    * {@inheritDoc}
315    * 
316    * @see java.sql.PreparedStatement#setFloat(int, float)
317    */
318   public void setFloat(int parameterIndex, float x) throws SQLException {
319     if (shouldThrow(this.getClass().getInterfaces()[0], "setFloat"))
320       throw new SQLException("PreparedStatement bombed");
321     it.setFloat(parameterIndex, x);
322   }
323 
324   /**
325    * {@inheritDoc}
326    * 
327    * @see java.sql.PreparedStatement#setInt(int, int)
328    */
329   public void setInt(int parameterIndex, int x) throws SQLException {
330     if (shouldThrow(this.getClass().getInterfaces()[0], "setInt"))
331       throw new SQLException("PreparedStatement bombed");
332     it.setInt(parameterIndex, x);
333   }
334 
335   /**
336    * {@inheritDoc}
337    * 
338    * @see java.sql.PreparedStatement#setLong(int, long)
339    */
340   public void setLong(int parameterIndex, long x) throws SQLException {
341     if (shouldThrow(this.getClass().getInterfaces()[0], "setLong"))
342       throw new SQLException("PreparedStatement bombed");
343     it.setLong(parameterIndex, x);
344   }
345 
346   /**
347    * {@inheritDoc}
348    * 
349    * @see java.sql.PreparedStatement#setNull(int, int)
350    */
351   public void setNull(int parameterIndex, int sqlType) throws SQLException {
352     if (shouldThrow(this.getClass().getInterfaces()[0], "setNull"))
353       throw new SQLException("PreparedStatement bombed");
354     it.setNull(parameterIndex, sqlType);
355   }
356 
357   /**
358    * {@inheritDoc}
359    * 
360    * @see java.sql.PreparedStatement#setNull(int, int, java.lang.String)
361    */
362   public void setNull(int paramIndex, int sqlType, String typeName)
363       throws SQLException {
364     if (shouldThrow(this.getClass().getInterfaces()[0], "setNull"))
365       throw new SQLException("PreparedStatement bombed");
366     it.setNull(paramIndex, sqlType, typeName);
367   }
368 
369   /**
370    * {@inheritDoc}
371    * 
372    * @see java.sql.PreparedStatement#setObject(int, java.lang.Object)
373    */
374   public void setObject(int parameterIndex, Object x) throws SQLException {
375     if (shouldThrow(this.getClass().getInterfaces()[0], "setObject"))
376       throw new SQLException("PreparedStatement bombed");
377     it.setObject(parameterIndex, x);
378   }
379 
380   /**
381    * {@inheritDoc}
382    * 
383    * @see java.sql.PreparedStatement#setObject(int, java.lang.Object, int)
384    */
385   public void setObject(int parameterIndex, Object x, int targetSqlType)
386       throws SQLException {
387     if (shouldThrow(this.getClass().getInterfaces()[0], "setObject"))
388       throw new SQLException("PreparedStatement bombed");
389     it.setObject(parameterIndex, x, targetSqlType);
390   }
391 
392   /**
393    * {@inheritDoc}
394    * 
395    * @see java.sql.PreparedStatement#setObject(int, java.lang.Object, int, int)
396    */
397   public void setObject(int parameterIndex, Object x, int targetSqlType,
398       int scale) throws SQLException {
399     if (shouldThrow(this.getClass().getInterfaces()[0], "setObject"))
400       throw new SQLException("PreparedStatement bombed");
401     it.setObject(parameterIndex, x, targetSqlType, scale);
402   }
403 
404   /**
405    * {@inheritDoc}
406    * 
407    * @see java.sql.PreparedStatement#setRef(int, java.sql.Ref)
408    */
409   public void setRef(int i, Ref x) throws SQLException {
410     if (shouldThrow(this.getClass().getInterfaces()[0], "setRef"))
411       throw new SQLException("PreparedStatement bombed");
412     it.setRef(i, x);
413   }
414 
415   /**
416    * {@inheritDoc}
417    * 
418    * @see java.sql.PreparedStatement#setShort(int, short)
419    */
420   public void setShort(int parameterIndex, short x) throws SQLException {
421     if (shouldThrow(this.getClass().getInterfaces()[0], "setShort"))
422       throw new SQLException("PreparedStatement bombed");
423     it.setShort(parameterIndex, x);
424   }
425 
426   /**
427    * {@inheritDoc}
428    * 
429    * @see java.sql.PreparedStatement#setString(int, java.lang.String)
430    */
431   public void setString(int parameterIndex, String x) throws SQLException {
432     if (shouldThrow(this.getClass().getInterfaces()[0], "setString"))
433       throw new SQLException("PreparedStatement bombed");
434     it.setString(parameterIndex, x);
435   }
436 
437   /**
438    * {@inheritDoc}
439    * 
440    * @see java.sql.PreparedStatement#setTime(int, java.sql.Time)
441    */
442   public void setTime(int parameterIndex, Time x) throws SQLException {
443     if (shouldThrow(this.getClass().getInterfaces()[0], "setTime"))
444       throw new SQLException("PreparedStatement bombed");
445     it.setTime(parameterIndex, x);
446   }
447 
448   /**
449    * {@inheritDoc}
450    * 
451    * @see java.sql.PreparedStatement#setTime(int, java.sql.Time,
452    *      java.util.Calendar)
453    */
454   public void setTime(int parameterIndex, Time x, Calendar cal)
455       throws SQLException {
456     if (shouldThrow(this.getClass().getInterfaces()[0], "setTime"))
457       throw new SQLException("PreparedStatement bombed");
458     it.setTime(parameterIndex, x, cal);
459   }
460 
461   /**
462    * {@inheritDoc}
463    * 
464    * @see java.sql.PreparedStatement#setTimestamp(int, java.sql.Timestamp)
465    */
466   public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException {
467     if (shouldThrow(this.getClass().getInterfaces()[0], "setTimestamp"))
468       throw new SQLException("PreparedStatement bombed");
469     it.setTimestamp(parameterIndex, x);
470   }
471 
472   /**
473    * {@inheritDoc}
474    * 
475    * @see java.sql.PreparedStatement#setTimestamp(int, java.sql.Timestamp,
476    *      java.util.Calendar)
477    */
478   public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)
479       throws SQLException {
480     if (shouldThrow(this.getClass().getInterfaces()[0], "setTimestamp"))
481       throw new SQLException("PreparedStatement bombed");
482     it.setTimestamp(parameterIndex, x, cal);
483   }
484 
485   /**
486    * {@inheritDoc}
487    * 
488    * @see java.sql.PreparedStatement#setURL(int, java.net.URL)
489    */
490   public void setURL(int parameterIndex, URL x) throws SQLException {
491     if (shouldThrow(this.getClass().getInterfaces()[0], "setURL"))
492       throw new SQLException("PreparedStatement bombed");
493     it.setURL(parameterIndex, x);
494   }
495 
496   /**
497    * {@inheritDoc}
498    * 
499    * @see java.sql.PreparedStatement#setUnicodeStream(int, java.io.InputStream,
500    *      int)
501    */
502   public void setUnicodeStream(int parameterIndex, InputStream x, int length)
503       throws SQLException {
504     if (shouldThrow(this.getClass().getInterfaces()[0], "setUnicodeStream"))
505       throw new SQLException("PreparedStatement bombed");
506     it.setUnicodeStream(parameterIndex, x, length);
507   }
508 
509   /**
510    * {@inheritDoc}
511    * 
512    * @see java.sql.Statement#addBatch(java.lang.String)
513    */
514   public void addBatch(String sql) throws SQLException {
515     if (shouldThrow(this.getClass().getInterfaces()[0], "addBatch"))
516       throw new SQLException("PreparedStatement bombed");
517     it.addBatch();
518   }
519 
520   /**
521    * {@inheritDoc}
522    * 
523    * @see java.sql.Statement#cancel()
524    */
525   public void cancel() throws SQLException {
526     if (shouldThrow(this.getClass().getInterfaces()[0], "cancel"))
527       throw new SQLException("PreparedStatement bombed");
528     it.cancel();
529   }
530 
531   /**
532    * {@inheritDoc}
533    * 
534    * @see java.sql.Statement#clearBatch()
535    */
536   public void clearBatch() throws SQLException {
537     if (shouldThrow(this.getClass().getInterfaces()[0], "clearBatch"))
538       throw new SQLException("PreparedStatement bombed");
539     it.clearBatch();
540   }
541 
542   /**
543    * {@inheritDoc}
544    * 
545    * @see java.sql.Statement#clearWarnings()
546    */
547   public void clearWarnings() throws SQLException {
548     if (shouldThrow(this.getClass().getInterfaces()[0], "clearWarnings"))
549       throw new SQLException("PreparedStatement bombed");
550     it.clearWarnings();
551   }
552 
553   /**
554    * {@inheritDoc}
555    * 
556    * @see java.sql.Statement#close()
557    */
558   public void close() throws SQLException {
559     if (shouldThrow(this.getClass().getInterfaces()[0], "close"))
560       throw new SQLException("PreparedStatement bombed");
561     it.close();
562   }
563 
564   /**
565    * {@inheritDoc}
566    * 
567    * @see java.sql.Statement#execute(java.lang.String)
568    */
569   public boolean execute(String sql) throws SQLException {
570     if (shouldThrow(this.getClass().getInterfaces()[0], "execute"))
571       throw new SQLException("PreparedStatement bombed");
572 
573     return it.execute(sql);
574   }
575 
576   /**
577    * {@inheritDoc}
578    * 
579    * @see java.sql.Statement#execute(java.lang.String, int)
580    */
581   public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
582     if (shouldThrow(this.getClass().getInterfaces()[0], "execute"))
583       throw new SQLException("PreparedStatement bombed");
584 
585     return it.execute(sql, autoGeneratedKeys);
586   }
587 
588   /**
589    * {@inheritDoc}
590    * 
591    * @see java.sql.Statement#execute(java.lang.String, int[])
592    */
593   public boolean execute(String sql, int[] columnIndexes) throws SQLException {
594     if (shouldThrow(this.getClass().getInterfaces()[0], "execute"))
595       throw new SQLException("PreparedStatement bombed");
596 
597     return it.execute(sql, columnIndexes);
598   }
599 
600   /**
601    * {@inheritDoc}
602    * 
603    * @see java.sql.Statement#execute(java.lang.String, java.lang.String[])
604    */
605   public boolean execute(String sql, String[] columnNames) throws SQLException {
606     if (shouldThrow(this.getClass().getInterfaces()[0], "execute"))
607       throw new SQLException("PreparedStatement bombed");
608 
609     return it.execute(sql, columnNames);
610   }
611 
612   /**
613    * {@inheritDoc}
614    * 
615    * @see java.sql.Statement#executeBatch()
616    */
617   public int[] executeBatch() throws SQLException {
618     if (shouldThrow(this.getClass().getInterfaces()[0], "executeBatch"))
619       throw new SQLException("PreparedStatement bombed");
620 
621     return it.executeBatch();
622   }
623 
624   /**
625    * {@inheritDoc}
626    * 
627    * @see java.sql.Statement#executeQuery(java.lang.String)
628    */
629   public ResultSet executeQuery(String sql) throws SQLException {
630     if (shouldThrow(this.getClass().getInterfaces()[0], "executeQuery"))
631       throw new SQLException("PreparedStatement bombed");
632 
633     return new ThrowingResultSet(it.executeQuery(sql));
634   }
635 
636   /**
637    * {@inheritDoc}
638    * 
639    * @see java.sql.Statement#executeUpdate(java.lang.String)
640    */
641   public int executeUpdate(String sql) throws SQLException {
642     if (shouldThrow(this.getClass().getInterfaces()[0], "executeUpdate"))
643       throw new SQLException("PreparedStatement bombed");
644 
645     return it.executeUpdate(sql);
646   }
647 
648   /**
649    * {@inheritDoc}
650    * 
651    * @see java.sql.Statement#executeUpdate(java.lang.String, int)
652    */
653   public int executeUpdate(String sql, int autoGeneratedKeys)
654       throws SQLException {
655     if (shouldThrow(this.getClass().getInterfaces()[0], "executeUpdate"))
656       throw new SQLException("PreparedStatement bombed");
657 
658     return it.executeUpdate(sql, autoGeneratedKeys);
659   }
660 
661   /**
662    * {@inheritDoc}
663    * 
664    * @see java.sql.Statement#executeUpdate(java.lang.String, int[])
665    */
666   public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
667     if (shouldThrow(this.getClass().getInterfaces()[0], "executeUpdate"))
668       throw new SQLException("PreparedStatement bombed");
669 
670     return it.executeUpdate(sql, columnIndexes);
671   }
672 
673   /**
674    * {@inheritDoc}
675    * 
676    * @see java.sql.Statement#executeUpdate(java.lang.String, java.lang.String[])
677    */
678   public int executeUpdate(String sql, String[] columnNames)
679       throws SQLException {
680     if (shouldThrow(this.getClass().getInterfaces()[0], "executeUpdate"))
681       throw new SQLException("PreparedStatement bombed");
682 
683     return it.executeUpdate(sql, columnNames);
684   }
685 
686   /**
687    * {@inheritDoc}
688    * 
689    * @see java.sql.Statement#getConnection()
690    */
691   public Connection getConnection() throws SQLException {
692     if (shouldThrow(this.getClass().getInterfaces()[0], "getConnection"))
693       throw new SQLException("PreparedStatement bombed");
694 
695     return new ThrowingConnection(it.getConnection());
696   }
697 
698   /**
699    * {@inheritDoc}
700    * 
701    * @see java.sql.Statement#getFetchDirection()
702    */
703   public int getFetchDirection() throws SQLException {
704     if (shouldThrow(this.getClass().getInterfaces()[0], "getFetchDirection"))
705       throw new SQLException("PreparedStatement bombed");
706 
707     return it.getFetchDirection();
708   }
709 
710   /**
711    * {@inheritDoc}
712    * 
713    * @see java.sql.Statement#getFetchSize()
714    */
715   public int getFetchSize() throws SQLException {
716     if (shouldThrow(this.getClass().getInterfaces()[0], "getFetchSize"))
717       throw new SQLException("PreparedStatement bombed");
718 
719     return it.getFetchSize();
720   }
721 
722   /**
723    * {@inheritDoc}
724    * 
725    * @see java.sql.Statement#getGeneratedKeys()
726    */
727   public ResultSet getGeneratedKeys() throws SQLException {
728     if (shouldThrow(this.getClass().getInterfaces()[0], "getGeneratedKeys"))
729       throw new SQLException("PreparedStatement bombed");
730 
731     return new ThrowingResultSet(it.getGeneratedKeys());
732   }
733 
734   /**
735    * {@inheritDoc}
736    * 
737    * @see java.sql.Statement#getMaxFieldSize()
738    */
739   public int getMaxFieldSize() throws SQLException {
740     if (shouldThrow(this.getClass().getInterfaces()[0], "getMaxFieldSize"))
741       throw new SQLException("PreparedStatement bombed");
742 
743     return it.getMaxFieldSize();
744   }
745 
746   /**
747    * {@inheritDoc}
748    * 
749    * @see java.sql.Statement#getMaxRows()
750    */
751   public int getMaxRows() throws SQLException {
752     if (shouldThrow(this.getClass().getInterfaces()[0], "getMaxRows"))
753       throw new SQLException("PreparedStatement bombed");
754 
755     return it.getMaxRows();
756   }
757 
758   /**
759    * {@inheritDoc}
760    * 
761    * @see java.sql.Statement#getMoreResults()
762    */
763   public boolean getMoreResults() throws SQLException {
764     if (shouldThrow(this.getClass().getInterfaces()[0], "getMoreResults"))
765       throw new SQLException("PreparedStatement bombed");
766 
767     return it.getMoreResults();
768   }
769 
770   /**
771    * {@inheritDoc}
772    * 
773    * @see java.sql.Statement#getMoreResults(int)
774    */
775   public boolean getMoreResults(int current) throws SQLException {
776     if (shouldThrow(this.getClass().getInterfaces()[0], "getMoreResults"))
777       throw new SQLException("PreparedStatement bombed");
778 
779     return it.getMoreResults(current);
780   }
781 
782   /**
783    * {@inheritDoc}
784    * 
785    * @see java.sql.Statement#getQueryTimeout()
786    */
787   public int getQueryTimeout() throws SQLException {
788     if (shouldThrow(this.getClass().getInterfaces()[0], "getQueryTimeout"))
789       throw new SQLException("PreparedStatement bombed");
790 
791     return it.getQueryTimeout();
792   }
793 
794   /**
795    * {@inheritDoc}
796    * 
797    * @see java.sql.Statement#getResultSet()
798    */
799   public ResultSet getResultSet() throws SQLException {
800     if (shouldThrow(this.getClass().getInterfaces()[0], "getResultSet"))
801       throw new SQLException("PreparedStatement bombed");
802 
803     return new ThrowingResultSet(it.getResultSet());
804   }
805 
806   /**
807    * {@inheritDoc}
808    * 
809    * @see java.sql.Statement#getResultSetConcurrency()
810    */
811   public int getResultSetConcurrency() throws SQLException {
812     if (shouldThrow(this.getClass().getInterfaces()[0], "getResultSetConcurrency"))
813       throw new SQLException("PreparedStatement bombed");
814 
815     return it.getResultSetConcurrency();
816   }
817 
818   /**
819    * {@inheritDoc}
820    * 
821    * @see java.sql.Statement#getResultSetHoldability()
822    */
823   public int getResultSetHoldability() throws SQLException {
824     if (shouldThrow(this.getClass().getInterfaces()[0], "getResultSetHoldability"))
825       throw new SQLException("PreparedStatement bombed");
826 
827     return it.getResultSetHoldability();
828   }
829 
830   /**
831    * {@inheritDoc}
832    * 
833    * @see java.sql.Statement#getResultSetType()
834    */
835   public int getResultSetType() throws SQLException {
836     if (shouldThrow(this.getClass().getInterfaces()[0], "getResultSetType"))
837       throw new SQLException("PreparedStatement bombed");
838 
839     return it.getResultSetType();
840   }
841 
842   /**
843    * {@inheritDoc}
844    * 
845    * @see java.sql.Statement#getUpdateCount()
846    */
847   public int getUpdateCount() throws SQLException {
848     if (shouldThrow(this.getClass().getInterfaces()[0], "getUpdateCount"))
849       throw new SQLException("PreparedStatement bombed");
850 
851     return it.getUpdateCount();
852   }
853 
854   /**
855    * {@inheritDoc}
856    * 
857    * @see java.sql.Statement#getWarnings()
858    */
859   public SQLWarning getWarnings() throws SQLException {
860     if (shouldThrow(this.getClass().getInterfaces()[0], "getWarnings"))
861       throw new SQLException("PreparedStatement bombed");
862 
863     return it.getWarnings();
864   }
865 
866   /**
867    * {@inheritDoc}
868    * 
869    * @see java.sql.Statement#setCursorName(java.lang.String)
870    */
871   public void setCursorName(String name) throws SQLException {
872     if (shouldThrow(this.getClass().getInterfaces()[0], "setCursorName"))
873       throw new SQLException("PreparedStatement bombed");
874     it.setCursorName(name);
875   }
876 
877   /**
878    * {@inheritDoc}
879    * 
880    * @see java.sql.Statement#setEscapeProcessing(boolean)
881    */
882   public void setEscapeProcessing(boolean enable) throws SQLException {
883     if (shouldThrow(this.getClass().getInterfaces()[0], "setEscapeProcessing"))
884       throw new SQLException("PreparedStatement bombed");
885     it.setEscapeProcessing(enable);
886   }
887 
888   /**
889    * {@inheritDoc}
890    * 
891    * @see java.sql.Statement#setFetchDirection(int)
892    */
893   public void setFetchDirection(int direction) throws SQLException {
894     if (shouldThrow(this.getClass().getInterfaces()[0], "setFetchDirection"))
895       throw new SQLException("PreparedStatement bombed");
896     it.setFetchDirection(direction);
897   }
898 
899   /**
900    * {@inheritDoc}
901    * 
902    * @see java.sql.Statement#setFetchSize(int)
903    */
904   public void setFetchSize(int rows) throws SQLException {
905     if (shouldThrow(this.getClass().getInterfaces()[0], "setFetchSize"))
906       throw new SQLException("PreparedStatement bombed");
907     it.setFetchSize(rows);
908   }
909 
910   /**
911    * {@inheritDoc}
912    * 
913    * @see java.sql.Statement#setMaxFieldSize(int)
914    */
915   public void setMaxFieldSize(int max) throws SQLException {
916     if (shouldThrow(this.getClass().getInterfaces()[0], "setMaxFieldSize"))
917       throw new SQLException("PreparedStatement bombed");
918     it.setMaxFieldSize(max);
919   }
920 
921   /**
922    * {@inheritDoc}
923    * 
924    * @see java.sql.Statement#setMaxRows(int)
925    */
926   public void setMaxRows(int max) throws SQLException {
927     if (shouldThrow(this.getClass().getInterfaces()[0], "setMaxRows"))
928       throw new SQLException("PreparedStatement bombed");
929     it.setMaxRows(max);
930   }
931 
932   /**
933    * {@inheritDoc}
934    * 
935    * @see java.sql.Statement#setQueryTimeout(int)
936    */
937   public void setQueryTimeout(int seconds) throws SQLException {
938     if (shouldThrow(this.getClass().getInterfaces()[0], "setQueryTimeout"))
939       throw new SQLException("PreparedStatement bombed");
940     it.setQueryTimeout(seconds);
941   }
942   
943 
944 }