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