View Javadoc
1   package org.davidmoten.rx.jdbc;
2   
3   import java.io.InputStream;
4   import java.io.Reader;
5   import java.math.BigDecimal;
6   import java.net.URL;
7   import java.sql.Array;
8   import java.sql.Blob;
9   import java.sql.Clob;
10  import java.sql.Date;
11  import java.sql.NClob;
12  import java.sql.ParameterMetaData;
13  import java.sql.PreparedStatement;
14  import java.sql.Ref;
15  import java.sql.ResultSetMetaData;
16  import java.sql.RowId;
17  import java.sql.SQLException;
18  import java.sql.SQLWarning;
19  import java.sql.SQLXML;
20  import java.sql.Time;
21  import java.sql.Timestamp;
22  import java.util.Calendar;
23  
24  final class TransactedPreparedStatement implements PreparedStatement {
25  
26      private final TransactedConnection con;
27      private final PreparedStatement ps;
28  
29      TransactedPreparedStatement(TransactedConnection con, PreparedStatement ps) {
30          this.con = con;
31          this.ps = ps;
32      }
33  
34      @Override
35      public void addBatch() throws SQLException {
36          ps.addBatch();
37      }
38  
39      @Override
40      public void addBatch(String arg0) throws SQLException {
41          ps.addBatch(arg0);
42      }
43  
44      @Override
45      public void cancel() throws SQLException {
46          ps.cancel();
47      }
48  
49      @Override
50      public void clearBatch() throws SQLException {
51          ps.clearBatch();
52      }
53  
54      @Override
55      public void clearParameters() throws SQLException {
56          ps.clearParameters();
57      }
58  
59      @Override
60      public void clearWarnings() throws SQLException {
61          ps.clearWarnings();
62      }
63  
64      @Override
65      public void close() throws SQLException {
66          ps.close();
67      }
68  
69      @Override
70      public void closeOnCompletion() throws SQLException {
71          ps.closeOnCompletion();
72      }
73  
74      @Override
75      public boolean execute() throws SQLException {
76          return ps.execute();
77      }
78  
79      @Override
80      public boolean execute(String arg0, int arg1) throws SQLException {
81          return ps.execute(arg0, arg1);
82      }
83  
84      @Override
85      public boolean execute(String arg0, int[] arg1) throws SQLException {
86          return ps.execute(arg0, arg1);
87      }
88  
89      @Override
90      public boolean execute(String arg0, String[] arg1) throws SQLException {
91          return ps.execute(arg0, arg1);
92      }
93  
94      @Override
95      public boolean execute(String arg0) throws SQLException {
96          return ps.execute(arg0);
97      }
98  
99      @Override
100     public int[] executeBatch() throws SQLException {
101         return ps.executeBatch();
102     }
103 
104     @Override
105     public TransactedResultSet executeQuery() throws SQLException {
106         return new TransactedResultSet(this, ps.executeQuery());
107     }
108 
109     @Override
110     public TransactedResultSet executeQuery(String sql) throws SQLException {
111         return new TransactedResultSet(this, ps.executeQuery(sql));
112     }
113 
114     @Override
115     public int executeUpdate() throws SQLException {
116         return ps.executeUpdate();
117     }
118 
119     @Override
120     public int executeUpdate(String arg0, int arg1) throws SQLException {
121         return ps.executeUpdate(arg0, arg1);
122     }
123 
124     @Override
125     public int executeUpdate(String arg0, int[] arg1) throws SQLException {
126         return ps.executeUpdate(arg0, arg1);
127     }
128 
129     @Override
130     public int executeUpdate(String arg0, String[] arg1) throws SQLException {
131         return ps.executeUpdate(arg0, arg1);
132     }
133 
134     @Override
135     public int executeUpdate(String arg0) throws SQLException {
136         return ps.executeUpdate(arg0);
137     }
138 
139     @Override
140     public TransactedConnection getConnection() throws SQLException {
141         return con;
142     }
143 
144     @Override
145     public int getFetchDirection() throws SQLException {
146         return ps.getFetchDirection();
147     }
148 
149     @Override
150     public int getFetchSize() throws SQLException {
151         return ps.getFetchSize();
152     }
153 
154     @Override
155     public TransactedResultSet getGeneratedKeys() throws SQLException {
156         return new TransactedResultSet(this, ps.getGeneratedKeys());
157     }
158 
159     @Override
160     public int getMaxFieldSize() throws SQLException {
161         return ps.getMaxFieldSize();
162     }
163 
164     @Override
165     public int getMaxRows() throws SQLException {
166         return ps.getMaxRows();
167     }
168 
169     @Override
170     public ResultSetMetaData getMetaData() throws SQLException {
171         return ps.getMetaData();
172     }
173 
174     @Override
175     public boolean getMoreResults() throws SQLException {
176         return ps.getMoreResults();
177     }
178 
179     @Override
180     public boolean getMoreResults(int arg0) throws SQLException {
181         return ps.getMoreResults(arg0);
182     }
183 
184     @Override
185     public ParameterMetaData getParameterMetaData() throws SQLException {
186         return ps.getParameterMetaData();
187     }
188 
189     @Override
190     public int getQueryTimeout() throws SQLException {
191         return ps.getQueryTimeout();
192     }
193 
194     @Override
195     public TransactedResultSet getResultSet() throws SQLException {
196         return new TransactedResultSet(this, ps.getResultSet());
197     }
198 
199     @Override
200     public int getResultSetConcurrency() throws SQLException {
201         return ps.getResultSetConcurrency();
202     }
203 
204     @Override
205     public int getResultSetHoldability() throws SQLException {
206         return ps.getResultSetHoldability();
207     }
208 
209     @Override
210     public int getResultSetType() throws SQLException {
211         return ps.getResultSetType();
212     }
213 
214     @Override
215     public int getUpdateCount() throws SQLException {
216         return ps.getUpdateCount();
217     }
218 
219     @Override
220     public SQLWarning getWarnings() throws SQLException {
221         return ps.getWarnings();
222     }
223 
224     @Override
225     public boolean isCloseOnCompletion() throws SQLException {
226         return ps.isCloseOnCompletion();
227     }
228 
229     @Override
230     public boolean isClosed() throws SQLException {
231         return ps.isClosed();
232     }
233 
234     @Override
235     public boolean isPoolable() throws SQLException {
236         return ps.isPoolable();
237     }
238 
239     @Override
240     public boolean isWrapperFor(Class<?> arg0) throws SQLException {
241         return ps.isWrapperFor(arg0);
242     }
243 
244     @Override
245     public void setArray(int arg0, Array arg1) throws SQLException {
246         ps.setArray(arg0, arg1);
247     }
248 
249     @Override
250     public void setAsciiStream(int arg0, InputStream arg1, int arg2) throws SQLException {
251         ps.setAsciiStream(arg0, arg1, arg2);
252     }
253 
254     @Override
255     public void setAsciiStream(int arg0, InputStream arg1, long arg2) throws SQLException {
256         ps.setAsciiStream(arg0, arg1, arg2);
257     }
258 
259     @Override
260     public void setAsciiStream(int arg0, InputStream arg1) throws SQLException {
261         ps.setAsciiStream(arg0, arg1);
262     }
263 
264     @Override
265     public void setBigDecimal(int arg0, BigDecimal arg1) throws SQLException {
266         ps.setBigDecimal(arg0, arg1);
267     }
268 
269     @Override
270     public void setBinaryStream(int arg0, InputStream arg1, int arg2) throws SQLException {
271         ps.setBinaryStream(arg0, arg1, arg2);
272     }
273 
274     @Override
275     public void setBinaryStream(int arg0, InputStream arg1, long arg2) throws SQLException {
276         ps.setBinaryStream(arg0, arg1, arg2);
277     }
278 
279     @Override
280     public void setBinaryStream(int arg0, InputStream arg1) throws SQLException {
281         ps.setBinaryStream(arg0, arg1);
282     }
283 
284     @Override
285     public void setBlob(int arg0, Blob arg1) throws SQLException {
286         ps.setBlob(arg0, arg1);
287     }
288 
289     @Override
290     public void setBlob(int arg0, InputStream arg1, long arg2) throws SQLException {
291         ps.setBlob(arg0, arg1, arg2);
292     }
293 
294     @Override
295     public void setBlob(int arg0, InputStream arg1) throws SQLException {
296         ps.setBlob(arg0, arg1);
297     }
298 
299     @Override
300     public void setBoolean(int arg0, boolean arg1) throws SQLException {
301         ps.setBoolean(arg0, arg1);
302     }
303 
304     @Override
305     public void setByte(int arg0, byte arg1) throws SQLException {
306         ps.setByte(arg0, arg1);
307     }
308 
309     @Override
310     public void setBytes(int arg0, byte[] arg1) throws SQLException {
311         ps.setBytes(arg0, arg1);
312     }
313 
314     @Override
315     public void setCharacterStream(int arg0, Reader arg1, int arg2) throws SQLException {
316         ps.setCharacterStream(arg0, arg1, arg2);
317     }
318 
319     @Override
320     public void setCharacterStream(int arg0, Reader arg1, long arg2) throws SQLException {
321         ps.setCharacterStream(arg0, arg1, arg2);
322     }
323 
324     @Override
325     public void setCharacterStream(int arg0, Reader arg1) throws SQLException {
326         ps.setCharacterStream(arg0, arg1);
327     }
328 
329     @Override
330     public void setClob(int arg0, Clob arg1) throws SQLException {
331         ps.setClob(arg0, arg1);
332     }
333 
334     @Override
335     public void setClob(int arg0, Reader arg1, long arg2) throws SQLException {
336         ps.setClob(arg0, arg1, arg2);
337     }
338 
339     @Override
340     public void setClob(int arg0, Reader arg1) throws SQLException {
341         ps.setClob(arg0, arg1);
342     }
343 
344     @Override
345     public void setCursorName(String arg0) throws SQLException {
346         ps.setCursorName(arg0);
347     }
348 
349     @Override
350     public void setDate(int arg0, Date arg1, Calendar arg2) throws SQLException {
351         ps.setDate(arg0, arg1, arg2);
352     }
353 
354     @Override
355     public void setDate(int arg0, Date arg1) throws SQLException {
356         ps.setDate(arg0, arg1);
357     }
358 
359     @Override
360     public void setDouble(int arg0, double arg1) throws SQLException {
361         ps.setDouble(arg0, arg1);
362     }
363 
364     @Override
365     public void setEscapeProcessing(boolean arg0) throws SQLException {
366         ps.setEscapeProcessing(arg0);
367     }
368 
369     @Override
370     public void setFetchDirection(int arg0) throws SQLException {
371         ps.setFetchDirection(arg0);
372     }
373 
374     @Override
375     public void setFetchSize(int arg0) throws SQLException {
376         ps.setFetchSize(arg0);
377     }
378 
379     @Override
380     public void setFloat(int arg0, float arg1) throws SQLException {
381         ps.setFloat(arg0, arg1);
382     }
383 
384     @Override
385     public void setInt(int arg0, int arg1) throws SQLException {
386         ps.setInt(arg0, arg1);
387     }
388 
389     @Override
390     public void setLong(int arg0, long arg1) throws SQLException {
391         ps.setLong(arg0, arg1);
392     }
393 
394     @Override
395     public void setMaxFieldSize(int arg0) throws SQLException {
396         ps.setMaxFieldSize(arg0);
397     }
398 
399     @Override
400     public void setMaxRows(int arg0) throws SQLException {
401         ps.setMaxRows(arg0);
402     }
403 
404     @Override
405     public void setNCharacterStream(int arg0, Reader arg1, long arg2) throws SQLException {
406         ps.setNCharacterStream(arg0, arg1, arg2);
407     }
408 
409     @Override
410     public void setNCharacterStream(int arg0, Reader arg1) throws SQLException {
411         ps.setNCharacterStream(arg0, arg1);
412     }
413 
414     @Override
415     public void setNClob(int arg0, NClob arg1) throws SQLException {
416         ps.setNClob(arg0, arg1);
417     }
418 
419     @Override
420     public void setNClob(int arg0, Reader arg1, long arg2) throws SQLException {
421         ps.setNClob(arg0, arg1, arg2);
422     }
423 
424     @Override
425     public void setNClob(int arg0, Reader arg1) throws SQLException {
426         ps.setNClob(arg0, arg1);
427     }
428 
429     @Override
430     public void setNString(int arg0, String arg1) throws SQLException {
431         ps.setNString(arg0, arg1);
432     }
433 
434     @Override
435     public void setNull(int arg0, int arg1, String arg2) throws SQLException {
436         ps.setNull(arg0, arg1, arg2);
437     }
438 
439     @Override
440     public void setNull(int arg0, int arg1) throws SQLException {
441         ps.setNull(arg0, arg1);
442     }
443 
444     @Override
445     public void setObject(int arg0, Object arg1, int arg2, int arg3) throws SQLException {
446         ps.setObject(arg0, arg1, arg2, arg3);
447     }
448 
449     @Override
450     public void setObject(int arg0, Object arg1, int arg2) throws SQLException {
451         ps.setObject(arg0, arg1, arg2);
452     }
453 
454     @Override
455     public void setObject(int arg0, Object arg1) throws SQLException {
456         ps.setObject(arg0, arg1);
457     }
458 
459     @Override
460     public void setPoolable(boolean arg0) throws SQLException {
461         ps.setPoolable(arg0);
462     }
463 
464     @Override
465     public void setQueryTimeout(int arg0) throws SQLException {
466         ps.setQueryTimeout(arg0);
467     }
468 
469     @Override
470     public void setRef(int arg0, Ref arg1) throws SQLException {
471         ps.setRef(arg0, arg1);
472     }
473 
474     @Override
475     public void setRowId(int arg0, RowId arg1) throws SQLException {
476         ps.setRowId(arg0, arg1);
477     }
478 
479     @Override
480     public void setSQLXML(int arg0, SQLXML arg1) throws SQLException {
481         ps.setSQLXML(arg0, arg1);
482     }
483 
484     @Override
485     public void setShort(int arg0, short arg1) throws SQLException {
486         ps.setShort(arg0, arg1);
487     }
488 
489     @Override
490     public void setString(int arg0, String arg1) throws SQLException {
491         ps.setString(arg0, arg1);
492     }
493 
494     @Override
495     public void setTime(int arg0, Time arg1, Calendar arg2) throws SQLException {
496         ps.setTime(arg0, arg1, arg2);
497     }
498 
499     @Override
500     public void setTime(int arg0, Time arg1) throws SQLException {
501         ps.setTime(arg0, arg1);
502     }
503 
504     @Override
505     public void setTimestamp(int arg0, Timestamp arg1, Calendar arg2) throws SQLException {
506         ps.setTimestamp(arg0, arg1, arg2);
507     }
508 
509     @Override
510     public void setTimestamp(int arg0, Timestamp arg1) throws SQLException {
511         ps.setTimestamp(arg0, arg1);
512     }
513 
514     @Override
515     public void setURL(int arg0, URL arg1) throws SQLException {
516         ps.setURL(arg0, arg1);
517     }
518 
519     @Override
520     @Deprecated
521     public void setUnicodeStream(int arg0, InputStream arg1, int arg2) throws SQLException {
522         ps.setUnicodeStream(arg0, arg1, arg2);
523     }
524 
525     @Override
526     public <T> T unwrap(Class<T> arg0) throws SQLException {
527         return ps.unwrap(arg0);
528     }
529 
530 }