1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45 package org.melati.poem.dbms.test.sql;
46
47 import java.sql.Connection;
48 import java.sql.ResultSet;
49 import java.sql.SQLException;
50 import java.sql.SQLWarning;
51 import java.sql.Statement;
52
53
54
55
56
57
58
59
60 public abstract class ThrowingStatementJdbc3
61 extends Thrower
62 implements Statement{
63
64 Statement it = null;
65
66
67
68
69
70
71 public void addBatch(String sql) throws SQLException {
72 if (shouldThrow(this.getClass().getInterfaces()[0], "addBatch"))
73 throw new SQLException("Statement bombed");
74 it.addBatch(sql);
75 }
76
77
78
79
80
81
82 public void cancel() throws SQLException {
83 if (shouldThrow(this.getClass().getInterfaces()[0], "cancel"))
84 throw new SQLException("Statement bombed");
85 it.cancel();
86
87 }
88
89
90
91
92
93
94 public void clearBatch() throws SQLException {
95 if (shouldThrow(this.getClass().getInterfaces()[0], "clearBatch"))
96 throw new SQLException("Statement bombed");
97 it.clearBatch();
98 }
99
100
101
102
103
104
105 public void clearWarnings() throws SQLException {
106 if (shouldThrow(this.getClass().getInterfaces()[0], "clearWarnings"))
107 throw new SQLException("Statement bombed");
108 it.clearWarnings();
109 }
110
111
112
113
114
115
116 public void close() throws SQLException {
117 if (shouldThrow(this.getClass().getInterfaces()[0], "close"))
118 throw new SQLException("Statement bombed");
119 it.close();
120 }
121
122
123
124
125
126
127 public boolean execute(String sql) throws SQLException {
128 if (shouldThrow(this.getClass().getInterfaces()[0], "execute"))
129 throw new SQLException("Statement bombed");
130
131 return it.execute(sql);
132 }
133
134
135
136
137
138
139 public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
140 if (shouldThrow(this.getClass().getInterfaces()[0], "execute"))
141 throw new SQLException("Statement bombed");
142
143 return it.execute(sql, autoGeneratedKeys);
144 }
145
146
147
148
149
150
151 public boolean execute(String sql, int[] columnIndexes) throws SQLException {
152 if (shouldThrow(this.getClass().getInterfaces()[0], "execute"))
153 throw new SQLException("Statement bombed");
154
155 return it.execute(sql, columnIndexes);
156 }
157
158
159
160
161
162
163 public boolean execute(String sql, String[] columnNames) throws SQLException {
164 if (shouldThrow(this.getClass().getInterfaces()[0], "execute"))
165 throw new SQLException("Statement bombed");
166
167 return it.execute(sql, columnNames);
168 }
169
170
171
172
173
174
175 public int[] executeBatch() throws SQLException {
176 if (shouldThrow(this.getClass().getInterfaces()[0], "executeBatch"))
177 throw new SQLException("Statement bombed");
178
179 return it.executeBatch();
180 }
181
182
183
184
185
186
187 public ResultSet executeQuery(String sql) throws SQLException {
188 if (shouldThrow(this.getClass().getInterfaces()[0], "executeQuery"))
189 throw new SQLException("Statement bombed");
190
191 return new ThrowingResultSet(it.executeQuery(sql));
192 }
193
194
195
196
197
198
199 public int executeUpdate(String sql) throws SQLException {
200 if (shouldThrow(this.getClass().getInterfaces()[0], "executeUpdate"))
201 throw new SQLException("Statement bombed");
202
203 return it.executeUpdate(sql);
204 }
205
206
207
208
209
210
211 public int executeUpdate(String sql, int autoGeneratedKeys)
212 throws SQLException {
213 if (shouldThrow(this.getClass().getInterfaces()[0], "executeUpdate"))
214 throw new SQLException("Statement bombed");
215
216 return it.executeUpdate(sql);
217 }
218
219
220
221
222
223
224 public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
225 if (shouldThrow(this.getClass().getInterfaces()[0], "executeUpdate"))
226 throw new SQLException("Statement bombed");
227
228 return it.executeUpdate(sql);
229 }
230
231
232
233
234
235
236 public int executeUpdate(String sql, String[] columnNames)
237 throws SQLException {
238 if (shouldThrow(this.getClass().getInterfaces()[0], "executeUpdate"))
239 throw new SQLException("Statement bombed");
240
241 return it.executeUpdate(sql,columnNames);
242 }
243
244
245
246
247
248
249 public Connection getConnection() throws SQLException {
250 if (shouldThrow(this.getClass().getInterfaces()[0], "getConnection"))
251 throw new SQLException("Statement bombed");
252
253 return new ThrowingConnection(it.getConnection());
254 }
255
256
257
258
259
260
261 public int getFetchDirection() throws SQLException {
262 if (shouldThrow(this.getClass().getInterfaces()[0], "getFetchDirection"))
263 throw new SQLException("Statement bombed");
264
265 return it.getFetchDirection();
266 }
267
268
269
270
271
272
273 public int getFetchSize() throws SQLException {
274 if (shouldThrow(this.getClass().getInterfaces()[0], "getFetchSize"))
275 throw new SQLException("Statement bombed");
276
277 return it.getFetchSize();
278 }
279
280
281
282
283
284
285 public ResultSet getGeneratedKeys() throws SQLException {
286 if (shouldThrow(this.getClass().getInterfaces()[0], "getGeneratedKeys"))
287 throw new SQLException("Statement bombed");
288
289 return new ThrowingResultSet(it.getGeneratedKeys());
290 }
291
292
293
294
295
296
297 public int getMaxFieldSize() throws SQLException {
298 if (shouldThrow(this.getClass().getInterfaces()[0], "getMaxFieldSize"))
299 throw new SQLException("Statement bombed");
300
301 return it.getMaxFieldSize();
302 }
303
304
305
306
307
308
309 public int getMaxRows() throws SQLException {
310 if (shouldThrow(this.getClass().getInterfaces()[0], "getMaxRows"))
311 throw new SQLException("Statement bombed");
312
313 return it.getMaxRows();
314 }
315
316
317
318
319
320
321 public boolean getMoreResults() throws SQLException {
322 if (shouldThrow(this.getClass().getInterfaces()[0], "getMoreResults"))
323 throw new SQLException("Statement bombed");
324
325 return it.getMoreResults();
326 }
327
328
329
330
331
332
333 public boolean getMoreResults(int current) throws SQLException {
334 if (shouldThrow(this.getClass().getInterfaces()[0], "getMoreResults"))
335 throw new SQLException("Statement bombed");
336
337 return it.getMoreResults(current);
338 }
339
340
341
342
343
344
345 public int getQueryTimeout() throws SQLException {
346 if (shouldThrow(this.getClass().getInterfaces()[0], "getQueryTimeout"))
347 throw new SQLException("Statement bombed");
348
349 return it.getQueryTimeout();
350 }
351
352
353
354
355
356
357 public ResultSet getResultSet() throws SQLException {
358 if (shouldThrow(this.getClass().getInterfaces()[0], "getResultSet"))
359 throw new SQLException("Statement bombed");
360
361 return new ThrowingResultSet(it.getResultSet());
362 }
363
364
365
366
367
368
369 public int getResultSetConcurrency() throws SQLException {
370 if (shouldThrow(this.getClass().getInterfaces()[0], "getResultSetConcurrency"))
371 throw new SQLException("Statement bombed");
372
373 return it.getResultSetConcurrency();
374 }
375
376
377
378
379
380
381 public int getResultSetHoldability() throws SQLException {
382 if (shouldThrow(this.getClass().getInterfaces()[0], "getResultSetHoldability"))
383 throw new SQLException("Statement bombed");
384
385 return it.getResultSetHoldability();
386 }
387
388
389
390
391
392
393 public int getResultSetType() throws SQLException {
394 if (shouldThrow(this.getClass().getInterfaces()[0], "getResultSetType"))
395 throw new SQLException("Statement bombed");
396
397 return it.getResultSetType();
398 }
399
400
401
402
403
404
405 public int getUpdateCount() throws SQLException {
406 if (shouldThrow(this.getClass().getInterfaces()[0], "getUpdateCount"))
407 throw new SQLException("Statement bombed");
408
409 return it.getUpdateCount();
410 }
411
412
413
414
415
416
417 public SQLWarning getWarnings() throws SQLException {
418 if (shouldThrow(this.getClass().getInterfaces()[0], "getWarnings"))
419 throw new SQLException("Statement bombed");
420
421 return it.getWarnings();
422 }
423
424
425
426
427
428
429 public void setCursorName(String name) throws SQLException {
430 if (shouldThrow(this.getClass().getInterfaces()[0], "setCursorName"))
431 throw new SQLException("Statement bombed");
432 it.setCursorName(name);
433 }
434
435
436
437
438
439
440 public void setEscapeProcessing(boolean enable) throws SQLException {
441 if (shouldThrow(this.getClass().getInterfaces()[0], "setEscapeProcessing"))
442 throw new SQLException("Statement bombed");
443 it.setEscapeProcessing(enable);
444 }
445
446
447
448
449
450
451 public void setFetchDirection(int direction) throws SQLException {
452 if (shouldThrow(this.getClass().getInterfaces()[0], "setFetchDirection"))
453 throw new SQLException("Statement bombed");
454 it.setFetchDirection(direction);
455 }
456
457
458
459
460
461
462 public void setFetchSize(int rows) throws SQLException {
463 if (shouldThrow(this.getClass().getInterfaces()[0], "setFetchSize"))
464 throw new SQLException("Statement bombed");
465 it.setFetchSize(rows);
466 }
467
468
469
470
471
472
473 public void setMaxFieldSize(int max) throws SQLException {
474 if (shouldThrow(this.getClass().getInterfaces()[0], "setMaxFieldSize"))
475 throw new SQLException("Statement bombed");
476 it.setMaxFieldSize(max);
477 }
478
479
480
481
482
483
484 public void setMaxRows(int max) throws SQLException {
485 if (shouldThrow(this.getClass().getInterfaces()[0], "setMaxRows"))
486 throw new SQLException("Statement bombed");
487 it.setMaxRows(max);
488 }
489
490
491
492
493
494
495 public void setQueryTimeout(int seconds) throws SQLException {
496 if (shouldThrow(this.getClass().getInterfaces()[0], "setQueryTimeout"))
497 throw new SQLException("Statement bombed");
498 it.setQueryTimeout(seconds);
499 }
500
501
502 }