View Javadoc
1   /*
2    * $Source$
3    * $Revision$
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   @SuppressWarnings("deprecation")
503   public void setUnicodeStream(int parameterIndex, InputStream x, int length)
504       throws SQLException {
505     if (shouldThrow(this.getClass().getInterfaces()[0], "setUnicodeStream"))
506       throw new SQLException("PreparedStatement bombed");
507     it.setUnicodeStream(parameterIndex, x, length);
508   }
509 
510   /**
511    * {@inheritDoc}
512    * 
513    * @see java.sql.Statement#addBatch(java.lang.String)
514    */
515   public void addBatch(String sql) throws SQLException {
516     if (shouldThrow(this.getClass().getInterfaces()[0], "addBatch"))
517       throw new SQLException("PreparedStatement bombed");
518     it.addBatch();
519   }
520 
521   /**
522    * {@inheritDoc}
523    * 
524    * @see java.sql.Statement#cancel()
525    */
526   public void cancel() throws SQLException {
527     if (shouldThrow(this.getClass().getInterfaces()[0], "cancel"))
528       throw new SQLException("PreparedStatement bombed");
529     it.cancel();
530   }
531 
532   /**
533    * {@inheritDoc}
534    * 
535    * @see java.sql.Statement#clearBatch()
536    */
537   public void clearBatch() throws SQLException {
538     if (shouldThrow(this.getClass().getInterfaces()[0], "clearBatch"))
539       throw new SQLException("PreparedStatement bombed");
540     it.clearBatch();
541   }
542 
543   /**
544    * {@inheritDoc}
545    * 
546    * @see java.sql.Statement#clearWarnings()
547    */
548   public void clearWarnings() throws SQLException {
549     if (shouldThrow(this.getClass().getInterfaces()[0], "clearWarnings"))
550       throw new SQLException("PreparedStatement bombed");
551     it.clearWarnings();
552   }
553 
554   /**
555    * {@inheritDoc}
556    * 
557    * @see java.sql.Statement#close()
558    */
559   public void close() throws SQLException {
560     if (shouldThrow(this.getClass().getInterfaces()[0], "close"))
561       throw new SQLException("PreparedStatement bombed");
562     it.close();
563   }
564 
565   /**
566    * {@inheritDoc}
567    * 
568    * @see java.sql.Statement#execute(java.lang.String)
569    */
570   public boolean execute(String sql) throws SQLException {
571     if (shouldThrow(this.getClass().getInterfaces()[0], "execute"))
572       throw new SQLException("PreparedStatement bombed");
573 
574     return it.execute(sql);
575   }
576 
577   /**
578    * {@inheritDoc}
579    * 
580    * @see java.sql.Statement#execute(java.lang.String, int)
581    */
582   public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
583     if (shouldThrow(this.getClass().getInterfaces()[0], "execute"))
584       throw new SQLException("PreparedStatement bombed");
585 
586     return it.execute(sql, autoGeneratedKeys);
587   }
588 
589   /**
590    * {@inheritDoc}
591    * 
592    * @see java.sql.Statement#execute(java.lang.String, int[])
593    */
594   public boolean execute(String sql, int[] columnIndexes) throws SQLException {
595     if (shouldThrow(this.getClass().getInterfaces()[0], "execute"))
596       throw new SQLException("PreparedStatement bombed");
597 
598     return it.execute(sql, columnIndexes);
599   }
600 
601   /**
602    * {@inheritDoc}
603    * 
604    * @see java.sql.Statement#execute(java.lang.String, java.lang.String[])
605    */
606   public boolean execute(String sql, String[] columnNames) throws SQLException {
607     if (shouldThrow(this.getClass().getInterfaces()[0], "execute"))
608       throw new SQLException("PreparedStatement bombed");
609 
610     return it.execute(sql, columnNames);
611   }
612 
613   /**
614    * {@inheritDoc}
615    * 
616    * @see java.sql.Statement#executeBatch()
617    */
618   public int[] executeBatch() throws SQLException {
619     if (shouldThrow(this.getClass().getInterfaces()[0], "executeBatch"))
620       throw new SQLException("PreparedStatement bombed");
621 
622     return it.executeBatch();
623   }
624 
625   /**
626    * {@inheritDoc}
627    * 
628    * @see java.sql.Statement#executeQuery(java.lang.String)
629    */
630   public ResultSet executeQuery(String sql) throws SQLException {
631     if (shouldThrow(this.getClass().getInterfaces()[0], "executeQuery"))
632       throw new SQLException("PreparedStatement bombed");
633 
634     return new ThrowingResultSet(it.executeQuery(sql));
635   }
636 
637   /**
638    * {@inheritDoc}
639    * 
640    * @see java.sql.Statement#executeUpdate(java.lang.String)
641    */
642   public int executeUpdate(String sql) throws SQLException {
643     if (shouldThrow(this.getClass().getInterfaces()[0], "executeUpdate"))
644       throw new SQLException("PreparedStatement bombed");
645 
646     return it.executeUpdate(sql);
647   }
648 
649   /**
650    * {@inheritDoc}
651    * 
652    * @see java.sql.Statement#executeUpdate(java.lang.String, int)
653    */
654   public int executeUpdate(String sql, int autoGeneratedKeys)
655       throws SQLException {
656     if (shouldThrow(this.getClass().getInterfaces()[0], "executeUpdate"))
657       throw new SQLException("PreparedStatement bombed");
658 
659     return it.executeUpdate(sql, autoGeneratedKeys);
660   }
661 
662   /**
663    * {@inheritDoc}
664    * 
665    * @see java.sql.Statement#executeUpdate(java.lang.String, int[])
666    */
667   public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
668     if (shouldThrow(this.getClass().getInterfaces()[0], "executeUpdate"))
669       throw new SQLException("PreparedStatement bombed");
670 
671     return it.executeUpdate(sql, columnIndexes);
672   }
673 
674   /**
675    * {@inheritDoc}
676    * 
677    * @see java.sql.Statement#executeUpdate(java.lang.String, java.lang.String[])
678    */
679   public int executeUpdate(String sql, String[] columnNames)
680       throws SQLException {
681     if (shouldThrow(this.getClass().getInterfaces()[0], "executeUpdate"))
682       throw new SQLException("PreparedStatement bombed");
683 
684     return it.executeUpdate(sql, columnNames);
685   }
686 
687   /**
688    * {@inheritDoc}
689    * 
690    * @see java.sql.Statement#getConnection()
691    */
692   public Connection getConnection() throws SQLException {
693     if (shouldThrow(this.getClass().getInterfaces()[0], "getConnection"))
694       throw new SQLException("PreparedStatement bombed");
695 
696     return new ThrowingConnection(it.getConnection());
697   }
698 
699   /**
700    * {@inheritDoc}
701    * 
702    * @see java.sql.Statement#getFetchDirection()
703    */
704   public int getFetchDirection() throws SQLException {
705     if (shouldThrow(this.getClass().getInterfaces()[0], "getFetchDirection"))
706       throw new SQLException("PreparedStatement bombed");
707 
708     return it.getFetchDirection();
709   }
710 
711   /**
712    * {@inheritDoc}
713    * 
714    * @see java.sql.Statement#getFetchSize()
715    */
716   public int getFetchSize() throws SQLException {
717     if (shouldThrow(this.getClass().getInterfaces()[0], "getFetchSize"))
718       throw new SQLException("PreparedStatement bombed");
719 
720     return it.getFetchSize();
721   }
722 
723   /**
724    * {@inheritDoc}
725    * 
726    * @see java.sql.Statement#getGeneratedKeys()
727    */
728   public ResultSet getGeneratedKeys() throws SQLException {
729     if (shouldThrow(this.getClass().getInterfaces()[0], "getGeneratedKeys"))
730       throw new SQLException("PreparedStatement bombed");
731 
732     return new ThrowingResultSet(it.getGeneratedKeys());
733   }
734 
735   /**
736    * {@inheritDoc}
737    * 
738    * @see java.sql.Statement#getMaxFieldSize()
739    */
740   public int getMaxFieldSize() throws SQLException {
741     if (shouldThrow(this.getClass().getInterfaces()[0], "getMaxFieldSize"))
742       throw new SQLException("PreparedStatement bombed");
743 
744     return it.getMaxFieldSize();
745   }
746 
747   /**
748    * {@inheritDoc}
749    * 
750    * @see java.sql.Statement#getMaxRows()
751    */
752   public int getMaxRows() throws SQLException {
753     if (shouldThrow(this.getClass().getInterfaces()[0], "getMaxRows"))
754       throw new SQLException("PreparedStatement bombed");
755 
756     return it.getMaxRows();
757   }
758 
759   /**
760    * {@inheritDoc}
761    * 
762    * @see java.sql.Statement#getMoreResults()
763    */
764   public boolean getMoreResults() throws SQLException {
765     if (shouldThrow(this.getClass().getInterfaces()[0], "getMoreResults"))
766       throw new SQLException("PreparedStatement bombed");
767 
768     return it.getMoreResults();
769   }
770 
771   /**
772    * {@inheritDoc}
773    * 
774    * @see java.sql.Statement#getMoreResults(int)
775    */
776   public boolean getMoreResults(int current) throws SQLException {
777     if (shouldThrow(this.getClass().getInterfaces()[0], "getMoreResults"))
778       throw new SQLException("PreparedStatement bombed");
779 
780     return it.getMoreResults(current);
781   }
782 
783   /**
784    * {@inheritDoc}
785    * 
786    * @see java.sql.Statement#getQueryTimeout()
787    */
788   public int getQueryTimeout() throws SQLException {
789     if (shouldThrow(this.getClass().getInterfaces()[0], "getQueryTimeout"))
790       throw new SQLException("PreparedStatement bombed");
791 
792     return it.getQueryTimeout();
793   }
794 
795   /**
796    * {@inheritDoc}
797    * 
798    * @see java.sql.Statement#getResultSet()
799    */
800   public ResultSet getResultSet() throws SQLException {
801     if (shouldThrow(this.getClass().getInterfaces()[0], "getResultSet"))
802       throw new SQLException("PreparedStatement bombed");
803 
804     return new ThrowingResultSet(it.getResultSet());
805   }
806 
807   /**
808    * {@inheritDoc}
809    * 
810    * @see java.sql.Statement#getResultSetConcurrency()
811    */
812   public int getResultSetConcurrency() throws SQLException {
813     if (shouldThrow(this.getClass().getInterfaces()[0], "getResultSetConcurrency"))
814       throw new SQLException("PreparedStatement bombed");
815 
816     return it.getResultSetConcurrency();
817   }
818 
819   /**
820    * {@inheritDoc}
821    * 
822    * @see java.sql.Statement#getResultSetHoldability()
823    */
824   public int getResultSetHoldability() throws SQLException {
825     if (shouldThrow(this.getClass().getInterfaces()[0], "getResultSetHoldability"))
826       throw new SQLException("PreparedStatement bombed");
827 
828     return it.getResultSetHoldability();
829   }
830 
831   /**
832    * {@inheritDoc}
833    * 
834    * @see java.sql.Statement#getResultSetType()
835    */
836   public int getResultSetType() throws SQLException {
837     if (shouldThrow(this.getClass().getInterfaces()[0], "getResultSetType"))
838       throw new SQLException("PreparedStatement bombed");
839 
840     return it.getResultSetType();
841   }
842 
843   /**
844    * {@inheritDoc}
845    * 
846    * @see java.sql.Statement#getUpdateCount()
847    */
848   public int getUpdateCount() throws SQLException {
849     if (shouldThrow(this.getClass().getInterfaces()[0], "getUpdateCount"))
850       throw new SQLException("PreparedStatement bombed");
851 
852     return it.getUpdateCount();
853   }
854 
855   /**
856    * {@inheritDoc}
857    * 
858    * @see java.sql.Statement#getWarnings()
859    */
860   public SQLWarning getWarnings() throws SQLException {
861     if (shouldThrow(this.getClass().getInterfaces()[0], "getWarnings"))
862       throw new SQLException("PreparedStatement bombed");
863 
864     return it.getWarnings();
865   }
866 
867   /**
868    * {@inheritDoc}
869    * 
870    * @see java.sql.Statement#setCursorName(java.lang.String)
871    */
872   public void setCursorName(String name) throws SQLException {
873     if (shouldThrow(this.getClass().getInterfaces()[0], "setCursorName"))
874       throw new SQLException("PreparedStatement bombed");
875     it.setCursorName(name);
876   }
877 
878   /**
879    * {@inheritDoc}
880    * 
881    * @see java.sql.Statement#setEscapeProcessing(boolean)
882    */
883   public void setEscapeProcessing(boolean enable) throws SQLException {
884     if (shouldThrow(this.getClass().getInterfaces()[0], "setEscapeProcessing"))
885       throw new SQLException("PreparedStatement bombed");
886     it.setEscapeProcessing(enable);
887   }
888 
889   /**
890    * {@inheritDoc}
891    * 
892    * @see java.sql.Statement#setFetchDirection(int)
893    */
894   public void setFetchDirection(int direction) throws SQLException {
895     if (shouldThrow(this.getClass().getInterfaces()[0], "setFetchDirection"))
896       throw new SQLException("PreparedStatement bombed");
897     it.setFetchDirection(direction);
898   }
899 
900   /**
901    * {@inheritDoc}
902    * 
903    * @see java.sql.Statement#setFetchSize(int)
904    */
905   public void setFetchSize(int rows) throws SQLException {
906     if (shouldThrow(this.getClass().getInterfaces()[0], "setFetchSize"))
907       throw new SQLException("PreparedStatement bombed");
908     it.setFetchSize(rows);
909   }
910 
911   /**
912    * {@inheritDoc}
913    * 
914    * @see java.sql.Statement#setMaxFieldSize(int)
915    */
916   public void setMaxFieldSize(int max) throws SQLException {
917     if (shouldThrow(this.getClass().getInterfaces()[0], "setMaxFieldSize"))
918       throw new SQLException("PreparedStatement bombed");
919     it.setMaxFieldSize(max);
920   }
921 
922   /**
923    * {@inheritDoc}
924    * 
925    * @see java.sql.Statement#setMaxRows(int)
926    */
927   public void setMaxRows(int max) throws SQLException {
928     if (shouldThrow(this.getClass().getInterfaces()[0], "setMaxRows"))
929       throw new SQLException("PreparedStatement bombed");
930     it.setMaxRows(max);
931   }
932 
933   /**
934    * {@inheritDoc}
935    * 
936    * @see java.sql.Statement#setQueryTimeout(int)
937    */
938   public void setQueryTimeout(int seconds) throws SQLException {
939     if (shouldThrow(this.getClass().getInterfaces()[0], "setQueryTimeout"))
940       throw new SQLException("PreparedStatement bombed");
941     it.setQueryTimeout(seconds);
942   }
943   
944 
945 }