001package org.javasimon.jdbc4;
002
003import java.io.InputStream;
004import java.io.Reader;
005import java.math.BigDecimal;
006import java.net.URL;
007import java.sql.*;
008import java.util.Calendar;
009import java.util.Map;
010
011/**
012 * Simon JDBC proxy callable statement implementation class.
013 *
014 * @author Radovan Sninsky
015 * @author <a href="mailto:virgo47@gmail.com">Richard "Virgo" Richter</a>
016 * @since 2.4
017 */
018public final class SimonCallableStatement extends SimonPreparedStatement implements CallableStatement {
019
020        private CallableStatement stmt;
021
022        /**
023         * Class constructor, initializes Simons (lifespan, active) related to statement.
024         *
025         * @param conn database connection (simon impl.)
026         * @param stmt real callable statement
027         * @param sql sql command
028         * @param prefix hierarchy prefix for statement Simons
029         * @param sqlNormalizerFactory factory to map queries to Simon keys
030         */
031        SimonCallableStatement(Connection conn, CallableStatement stmt, String sql, String prefix, SqlNormalizerFactory sqlNormalizerFactory) {
032                super(conn, stmt, sql, prefix, sqlNormalizerFactory);
033                this.stmt = stmt;
034        }
035
036        @Override
037        public void registerOutParameter(int i, int i1) throws SQLException {
038                stmt.registerOutParameter(i, i1);
039        }
040
041        @Override
042        public void registerOutParameter(int i, int i1, int i2) throws SQLException {
043                stmt.registerOutParameter(i, i1, i2);
044        }
045
046        @Override
047        public boolean wasNull() throws SQLException {
048                return stmt.wasNull();
049        }
050
051        @Override
052        public String getString(int i) throws SQLException {
053                return stmt.getString(i);
054        }
055
056        @Override
057        public boolean getBoolean(int i) throws SQLException {
058                return stmt.getBoolean(i);
059        }
060
061        @Override
062        public byte getByte(int i) throws SQLException {
063                return stmt.getByte(i);
064        }
065
066        @Override
067        public short getShort(int i) throws SQLException {
068                return stmt.getShort(i);
069        }
070
071        @Override
072        public int getInt(int i) throws SQLException {
073                return stmt.getInt(i);
074        }
075
076        @Override
077        public long getLong(int i) throws SQLException {
078                return stmt.getLong(i);
079        }
080
081        @Override
082        public float getFloat(int i) throws SQLException {
083                return stmt.getFloat(i);
084        }
085
086        @Override
087        public double getDouble(int i) throws SQLException {
088                return stmt.getDouble(i);
089        }
090
091        @Deprecated
092        @Override
093        public BigDecimal getBigDecimal(int i, int i1) throws SQLException {
094                return stmt.getBigDecimal(i, i1);
095        }
096
097        @Override
098        public byte[] getBytes(int i) throws SQLException {
099                return stmt.getBytes(i);
100        }
101
102        @Override
103        public Date getDate(int i) throws SQLException {
104                return stmt.getDate(i);
105        }
106
107        @Override
108        public Time getTime(int i) throws SQLException {
109                return stmt.getTime(i);
110        }
111
112        @Override
113        public Timestamp getTimestamp(int i) throws SQLException {
114                return stmt.getTimestamp(i);
115        }
116
117        @Override
118        public Object getObject(int i) throws SQLException {
119                return stmt.getObject(i);
120        }
121
122        @Override
123        public BigDecimal getBigDecimal(int i) throws SQLException {
124                return stmt.getBigDecimal(i);
125        }
126
127        @Override
128        public Object getObject(int i, Map<String, Class<?>> stringClassMap) throws SQLException {
129                return stmt.getObject(i, stringClassMap);
130        }
131
132        @Override
133        public Ref getRef(int i) throws SQLException {
134                return stmt.getRef(i);
135        }
136
137        @Override
138        public Blob getBlob(int i) throws SQLException {
139                return stmt.getBlob(i);
140        }
141
142        @Override
143        public Clob getClob(int i) throws SQLException {
144                return stmt.getClob(i);
145        }
146
147        @Override
148        public Array getArray(int i) throws SQLException {
149                return stmt.getArray(i);
150        }
151
152        @Override
153        public Date getDate(int i, Calendar calendar) throws SQLException {
154                return stmt.getDate(i, calendar);
155        }
156
157        @Override
158        public Time getTime(int i, Calendar calendar) throws SQLException {
159                return stmt.getTime(i, calendar);
160        }
161
162        @Override
163        public Timestamp getTimestamp(int i, Calendar calendar) throws SQLException {
164                return stmt.getTimestamp(i, calendar);
165        }
166
167        @Override
168        public void registerOutParameter(int i, int i1, String s) throws SQLException {
169                stmt.registerOutParameter(i, i1, s);
170        }
171
172        @Override
173        public void registerOutParameter(String s, int i) throws SQLException {
174                stmt.registerOutParameter(s, i);
175        }
176
177        @Override
178        public void registerOutParameter(String s, int i, int i1) throws SQLException {
179                stmt.registerOutParameter(s, i, i1);
180        }
181
182        @Override
183        public void registerOutParameter(String s, int i, String s1) throws SQLException {
184                stmt.registerOutParameter(s, i, s1);
185        }
186
187        @Override
188        public URL getURL(int i) throws SQLException {
189                return stmt.getURL(i);
190        }
191
192        @Override
193        public void setURL(String s, URL url) throws SQLException {
194                stmt.setURL(s, url);
195        }
196
197        @Override
198        public void setNull(String s, int i) throws SQLException {
199                stmt.setNull(s, i);
200        }
201
202        @Override
203        public void setBoolean(String s, boolean b) throws SQLException {
204                stmt.setBoolean(s, b);
205        }
206
207        @Override
208        public void setByte(String s, byte b) throws SQLException {
209                stmt.setByte(s, b);
210        }
211
212        @Override
213        public void setShort(String s, short i) throws SQLException {
214                stmt.setShort(s, i);
215        }
216
217        @Override
218        public void setInt(String s, int i) throws SQLException {
219                stmt.setInt(s, i);
220        }
221
222        @Override
223        public void setLong(String s, long l) throws SQLException {
224                stmt.setLong(s, l);
225        }
226
227        @Override
228        public void setFloat(String s, float v) throws SQLException {
229                stmt.setFloat(s, v);
230        }
231
232        @Override
233        public void setDouble(String s, double v) throws SQLException {
234                stmt.setDouble(s, v);
235        }
236
237        @Override
238        public void setBigDecimal(String s, BigDecimal bigDecimal) throws SQLException {
239                stmt.setBigDecimal(s, bigDecimal);
240        }
241
242        @Override
243        public void setString(String s, String s1) throws SQLException {
244                stmt.setString(s, s1);
245        }
246
247        @Override
248        public void setBytes(String s, byte[] bytes) throws SQLException {
249                stmt.setBytes(s, bytes);
250        }
251
252        @Override
253        public void setDate(String s, Date date) throws SQLException {
254                stmt.setDate(s, date);
255        }
256
257        @Override
258        public void setTime(String s, Time time) throws SQLException {
259                stmt.setTime(s, time);
260        }
261
262        @Override
263        public void setTimestamp(String s, Timestamp timestamp) throws SQLException {
264                stmt.setTimestamp(s, timestamp);
265        }
266
267        @Override
268        public void setAsciiStream(String s, InputStream inputStream, int i) throws SQLException {
269                stmt.setAsciiStream(s, inputStream, i);
270        }
271
272        @Override
273        public void setBinaryStream(String s, InputStream inputStream, int i) throws SQLException {
274                stmt.setBinaryStream(s, inputStream, i);
275        }
276
277        @Override
278        public void setObject(String s, Object o, int i, int i1) throws SQLException {
279                stmt.setObject(s, o, i, i1);
280        }
281
282        @Override
283        public void setObject(String s, Object o, int i) throws SQLException {
284                stmt.setObject(s, o, i);
285        }
286
287        @Override
288        public void setObject(String s, Object o) throws SQLException {
289                stmt.setObject(s, o);
290        }
291
292        @Override
293        public void setCharacterStream(String s, Reader reader, int i) throws SQLException {
294                stmt.setCharacterStream(s, reader, i);
295        }
296
297        @Override
298        public void setDate(String s, Date date, Calendar calendar) throws SQLException {
299                stmt.setDate(s, date, calendar);
300        }
301
302        @Override
303        public void setTime(String s, Time time, Calendar calendar) throws SQLException {
304                stmt.setTime(s, time, calendar);
305        }
306
307        @Override
308        public void setTimestamp(String s, Timestamp timestamp, Calendar calendar) throws SQLException {
309                stmt.setTimestamp(s, timestamp, calendar);
310        }
311
312        @Override
313        public void setNull(String s, int i, String s1) throws SQLException {
314                stmt.setNull(s, i, s1);
315        }
316
317        @Override
318        public String getString(String s) throws SQLException {
319                return stmt.getString(s);
320        }
321
322        @Override
323        public boolean getBoolean(String s) throws SQLException {
324                return stmt.getBoolean(s);
325        }
326
327        @Override
328        public byte getByte(String s) throws SQLException {
329                return stmt.getByte(s);
330        }
331
332        @Override
333        public short getShort(String s) throws SQLException {
334                return stmt.getShort(s);
335        }
336
337        @Override
338        public int getInt(String s) throws SQLException {
339                return stmt.getInt(s);
340        }
341
342        @Override
343        public long getLong(String s) throws SQLException {
344                return stmt.getLong(s);
345        }
346
347        @Override
348        public float getFloat(String s) throws SQLException {
349                return stmt.getFloat(s);
350        }
351
352        @Override
353        public double getDouble(String s) throws SQLException {
354                return stmt.getDouble(s);
355        }
356
357        @Override
358        public byte[] getBytes(String s) throws SQLException {
359                return stmt.getBytes(s);
360        }
361
362        @Override
363        public Date getDate(String s) throws SQLException {
364                return stmt.getDate(s);
365        }
366
367        @Override
368        public Time getTime(String s) throws SQLException {
369                return stmt.getTime(s);
370        }
371
372        @Override
373        public Timestamp getTimestamp(String s) throws SQLException {
374                return stmt.getTimestamp(s);
375        }
376
377        @Override
378        public Object getObject(String s) throws SQLException {
379                return stmt.getObject(s);
380        }
381
382        @Override
383        public BigDecimal getBigDecimal(String s) throws SQLException {
384                return stmt.getBigDecimal(s);
385        }
386
387        @Override
388        public Object getObject(String s, Map<String, Class<?>> stringClassMap) throws SQLException {
389                return stmt.getObject(s, stringClassMap);
390        }
391
392        @Override
393        public Ref getRef(String s) throws SQLException {
394                return stmt.getRef(s);
395        }
396
397        @Override
398        public Blob getBlob(String s) throws SQLException {
399                return stmt.getBlob(s);
400        }
401
402        @Override
403        public Clob getClob(String s) throws SQLException {
404                return stmt.getClob(s);
405        }
406
407        @Override
408        public Array getArray(String s) throws SQLException {
409                return stmt.getArray(s);
410        }
411
412        @Override
413        public Date getDate(String s, Calendar calendar) throws SQLException {
414                return stmt.getDate(s, calendar);
415        }
416
417        @Override
418        public Time getTime(String s, Calendar calendar) throws SQLException {
419                return stmt.getTime(s, calendar);
420        }
421
422        @Override
423        public Timestamp getTimestamp(String s, Calendar calendar) throws SQLException {
424                return stmt.getTimestamp(s, calendar);
425        }
426
427        @Override
428        public URL getURL(String s) throws SQLException {
429                return stmt.getURL(s);
430        }
431
432        @Override
433        public RowId getRowId(int i) throws SQLException {
434                return stmt.getRowId(i);
435        }
436
437        @Override
438        public RowId getRowId(String s) throws SQLException {
439                return stmt.getRowId(s);
440        }
441
442        @Override
443        public void setRowId(String s, RowId rowId) throws SQLException {
444                stmt.setRowId(s, rowId);
445        }
446
447        @Override
448        public void setNString(String s, String s1) throws SQLException {
449                stmt.setNString(s, s1);
450        }
451
452        @Override
453        public void setNCharacterStream(String s, Reader reader, long l) throws SQLException {
454                stmt.setNCharacterStream(s, reader, l);
455        }
456
457        @Override
458        public void setNClob(String s, NClob nClob) throws SQLException {
459                stmt.setNClob(s, nClob);
460        }
461
462        @Override
463        public void setClob(String s, Reader reader, long l) throws SQLException {
464                stmt.setClob(s, reader, l);
465        }
466
467        @Override
468        public void setBlob(String s, InputStream inputStream, long l) throws SQLException {
469                stmt.setBlob(s, inputStream, l);
470        }
471
472        @Override
473        public void setNClob(String s, Reader reader, long l) throws SQLException {
474                stmt.setNClob(s, reader, l);
475        }
476
477        @Override
478        public NClob getNClob(int i) throws SQLException {
479                return stmt.getNClob(i);
480        }
481
482        @Override
483        public NClob getNClob(String s) throws SQLException {
484                return stmt.getNClob(s);
485        }
486
487        @Override
488        public void setSQLXML(String s, SQLXML sqlxml) throws SQLException {
489                stmt.setSQLXML(s, sqlxml);
490        }
491
492        @Override
493        public SQLXML getSQLXML(int i) throws SQLException {
494                return stmt.getSQLXML(i);
495        }
496
497        @Override
498        public SQLXML getSQLXML(String s) throws SQLException {
499                return stmt.getSQLXML(s);
500        }
501
502        @Override
503        public String getNString(int i) throws SQLException {
504                return stmt.getNString(i);
505        }
506
507        @Override
508        public String getNString(String s) throws SQLException {
509                return stmt.getNString(s);
510        }
511
512        @Override
513        public Reader getNCharacterStream(int i) throws SQLException {
514                return stmt.getNCharacterStream(i);
515        }
516
517        @Override
518        public Reader getNCharacterStream(String s) throws SQLException {
519                return stmt.getNCharacterStream(s);
520        }
521
522        @Override
523        public Reader getCharacterStream(int i) throws SQLException {
524                return stmt.getCharacterStream(i);
525        }
526
527        @Override
528        public Reader getCharacterStream(String s) throws SQLException {
529                return stmt.getCharacterStream(s);
530        }
531
532        @Override
533        public void setBlob(String s, Blob blob) throws SQLException {
534                stmt.setBlob(s, blob);
535        }
536
537        @Override
538        public void setClob(String s, Clob clob) throws SQLException {
539                stmt.setClob(s, clob);
540        }
541
542        @Override
543        public void setAsciiStream(String s, InputStream inputStream, long l) throws SQLException {
544                stmt.setAsciiStream(s, inputStream, l);
545        }
546
547        @Override
548        public void setBinaryStream(String s, InputStream inputStream, long l) throws SQLException {
549                stmt.setBinaryStream(s, inputStream, l);
550        }
551
552        @Override
553        public void setCharacterStream(String s, Reader reader, long l) throws SQLException {
554                stmt.setCharacterStream(s, reader, l);
555        }
556
557        @Override
558        public void setAsciiStream(String s, InputStream inputStream) throws SQLException {
559                stmt.setAsciiStream(s, inputStream);
560        }
561
562        @Override
563        public void setBinaryStream(String s, InputStream inputStream) throws SQLException {
564                stmt.setBinaryStream(s, inputStream);
565        }
566
567        @Override
568        public void setCharacterStream(String s, Reader reader) throws SQLException {
569                stmt.setCharacterStream(s, reader);
570        }
571
572        @Override
573        public void setNCharacterStream(String s, Reader reader) throws SQLException {
574                stmt.setNCharacterStream(s, reader);
575        }
576
577        @Override
578        public void setClob(String s, Reader reader) throws SQLException {
579                stmt.setClob(s, reader);
580        }
581
582        @Override
583        public void setBlob(String s, InputStream inputStream) throws SQLException {
584                stmt.setBlob(s, inputStream);
585        }
586
587        @Override
588        public void setNClob(String s, Reader reader) throws SQLException {
589                stmt.setNClob(s, reader);
590        }
591
592        @Override
593        public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException {
594                return stmt.getObject(parameterIndex, type);
595        }
596
597        @Override
598        public <T> T getObject(String parameterName, Class<T> type) throws SQLException {
599                return stmt.getObject(parameterName, type);
600        }
601}