1 23 24 29 30 package com.sun.jdo.spi.persistence.support.sqlstore.connection; 31 32 import java.math.BigDecimal ; 33 import java.sql.*; 34 import java.net.URL ; 35 import java.util.Calendar ; 36 import java.util.Map ; 37 import java.io.InputStream ; 38 import java.io.Reader ; 39 40 41 42 48 public class CallableStatementImpl extends PreparedStatementImpl 49 implements CallableStatement { 50 public CallableStatementImpl(ConnectionImpl conn, 58 CallableStatement cstmt) { 59 super(); 60 this.conn = conn; 61 this.stmt = (Statement) cstmt; 62 } 63 64 67 public void registerOutParameter(int parameterIndex, int sqlType) 68 throws SQLException { 69 try { 70 CallableStatement cstmt = (CallableStatement) this.stmt; 71 cstmt.registerOutParameter(parameterIndex, sqlType); 72 } catch (SQLException se) { 73 throw se; 74 } 75 } 76 77 public void registerOutParameter(int parameterIndex, int sqlType, int scale) 78 throws SQLException { 79 try { 80 CallableStatement cstmt = (CallableStatement) this.stmt; 81 cstmt.registerOutParameter(parameterIndex, sqlType, scale); 82 } catch (SQLException se) { 83 throw se; 84 } 85 } 86 87 public boolean wasNull() throws SQLException { 88 CallableStatement cstmt = (CallableStatement) this.stmt; 89 90 try { 91 return (cstmt.wasNull()); 92 } catch (SQLException se) { 93 throw se; 94 } 95 } 96 97 public String getString(int parameterIndex) throws SQLException { 98 try { 99 CallableStatement cstmt = (CallableStatement) this.stmt; 100 return (cstmt.getString(parameterIndex)); 101 } catch (SQLException se) { 102 throw se; 103 } 104 } 105 106 public boolean getBoolean(int parameterIndex) throws SQLException { 107 try { 108 CallableStatement cstmt = (CallableStatement) this.stmt; 109 return (cstmt.getBoolean(parameterIndex)); 110 } catch (SQLException se) { 111 throw se; 112 } 113 } 114 115 public byte getByte(int parameterIndex) throws SQLException { 116 try { 117 CallableStatement cstmt = (CallableStatement) this.stmt; 118 return (cstmt.getByte(parameterIndex)); 119 } catch (SQLException se) { 120 throw se; 121 } 122 } 123 124 public short getShort(int parameterIndex) throws SQLException { 125 try { 126 CallableStatement cstmt = (CallableStatement) this.stmt; 127 return (cstmt.getShort(parameterIndex)); 128 } catch (SQLException se) { 129 throw se; 130 } 131 } 132 133 public int getInt(int parameterIndex) throws SQLException { 134 CallableStatement cstmt = (CallableStatement) this.stmt; 135 136 try { 137 return (cstmt.getShort(parameterIndex)); 138 } catch (SQLException se) { 139 throw se; 140 } 141 } 142 143 public long getLong(int parameterIndex) throws SQLException { 144 try { 145 CallableStatement cstmt = (CallableStatement) this.stmt; 146 return (cstmt.getLong(parameterIndex)); 147 } catch (SQLException se) { 148 throw se; 149 } 150 } 151 152 public float getFloat(int parameterIndex) throws SQLException { 153 try { 154 CallableStatement cstmt = (CallableStatement) this.stmt; 155 return (cstmt.getFloat(parameterIndex)); 156 } catch (SQLException se) { 157 throw se; 158 } 159 } 160 161 public double getDouble(int parameterIndex) throws SQLException { 162 try { 163 CallableStatement cstmt = (CallableStatement) this.stmt; 164 return (cstmt.getDouble(parameterIndex)); 165 } catch (SQLException se) { 166 throw se; 167 } 168 } 169 170 public BigDecimal getBigDecimal(int parameterIndex, int scale) 171 throws SQLException { 172 try { 173 CallableStatement cstmt = (CallableStatement) this.stmt; 174 return (cstmt.getBigDecimal(parameterIndex, scale)); 175 } catch (SQLException se) { 176 throw se; 177 } 178 } 179 180 public byte[] getBytes(int parameterIndex) throws SQLException { 181 try { 182 CallableStatement cstmt = (CallableStatement) this.stmt; 183 return (cstmt.getBytes(parameterIndex)); 184 } catch (SQLException se) { 185 throw se; 186 } 187 } 188 189 public java.sql.Date getDate(int parameterIndex) throws SQLException { 190 try { 191 CallableStatement cstmt = (CallableStatement) this.stmt; 192 return (cstmt.getDate(parameterIndex)); 193 } catch (SQLException se) { 194 throw se; 195 } 196 } 197 198 public java.sql.Time getTime(int parameterIndex) throws SQLException { 199 try { 200 CallableStatement cstmt = (CallableStatement) this.stmt; 201 return (cstmt.getTime(parameterIndex)); 202 } catch (SQLException se) { 203 throw se; 204 } 205 } 206 207 public java.sql.Timestamp getTimestamp(int parameterIndex) 208 throws SQLException { 209 try { 210 CallableStatement cstmt = (CallableStatement) this.stmt; 211 return (cstmt.getTimestamp(parameterIndex)); 212 } catch (SQLException se) { 213 throw se; 214 } 215 } 216 217 220 221 public Object getObject(int parameterIndex) throws SQLException { 222 try { 223 CallableStatement cstmt = (CallableStatement) this.stmt; 224 return (cstmt.getObject(parameterIndex)); 225 } catch (SQLException se) { 226 throw se; 227 } 228 } 229 230 232 public BigDecimal getBigDecimal(int parameterIndex) throws SQLException { 233 try { 234 CallableStatement cstmt = (CallableStatement) this.stmt; 235 return (cstmt.getBigDecimal(parameterIndex)); 236 } catch (SQLException se) { 237 throw se; 238 } 239 } 240 241 public Object getObject(int i, java.util.Map map) throws SQLException { 242 try { 243 CallableStatement cstmt = (CallableStatement) this.stmt; 244 return (cstmt.getObject(i, map)); 245 } catch (SQLException se) { 246 throw se; 247 } 248 } 249 250 public Ref getRef(int i) throws SQLException { 251 try { 252 CallableStatement cstmt = (CallableStatement) this.stmt; 253 return (cstmt.getRef(i)); 254 } catch (SQLException se) { 255 throw se; 256 } 257 } 258 259 public int getResultSetConcurrency() throws SQLException { 260 return 0; 261 } 262 263 265 public void registerOutParameter(int i, int j, String str) throws SQLException { 266 277 } 278 279 280 public void registerOutParameter(String parameterName,int sqlType) throws SQLException { 282 283 try { 284 CallableStatement cstmt = (CallableStatement) this.stmt; 285 cstmt.registerOutParameter(parameterName,sqlType); 286 } catch (SQLException se) { 287 throw se; 288 } 289 290 } 291 292 public void registerOutParameter(String parameterName,int sqlType,int scale) 293 throws SQLException { 294 try { 295 CallableStatement cstmt = (CallableStatement) this.stmt; 296 cstmt.registerOutParameter(parameterName,sqlType,scale); 297 } catch (SQLException se) { 298 throw se; 299 } 300 301 } 302 303 public void registerOutParameter(String parameterName,int sqlType,String typeName) 304 throws SQLException { 305 try { 306 CallableStatement cstmt = (CallableStatement) this.stmt; 307 cstmt.registerOutParameter(parameterName,sqlType,typeName); 308 } catch (SQLException se) { 309 throw se; 310 } 311 312 } 313 314 public java.net.URL getURL(int parameterIndex) throws SQLException { 315 316 throw new UnsupportedOperationException (); 317 } 318 319 public void setURL(String parameterName,URL val) throws SQLException { 320 321 throw new UnsupportedOperationException (); 322 } 323 324 public void setNull(String parameterName,int sqlType) throws SQLException { 325 326 throw new UnsupportedOperationException (); 327 } 328 329 public void setBoolean(String parameterName, boolean x) throws SQLException { 330 331 throw new UnsupportedOperationException (); 332 } 333 334 public void setByte(String parameterName, byte x) throws SQLException { 335 336 throw new UnsupportedOperationException (); 337 } 338 339 public void setShort(String parameterName, short x) throws SQLException { 340 341 throw new UnsupportedOperationException (); 342 } 343 344 public void setInt(String parameterName, int x) throws SQLException { 345 346 throw new UnsupportedOperationException (); 347 } 348 349 public void setLong(String parameterName, long x) throws SQLException { 350 351 throw new UnsupportedOperationException (); 352 } 353 354 public void setFloat(String parameterName, float x) throws SQLException { 355 356 throw new UnsupportedOperationException (); 357 } 358 359 public void setDouble(String parameterName, double x) throws SQLException { 360 361 throw new UnsupportedOperationException (); 362 } 363 364 public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException { 365 366 throw new UnsupportedOperationException (); 367 } 368 369 public void setString(String parameterName, String x) throws SQLException { 370 371 throw new UnsupportedOperationException (); 372 } 373 374 public void setBytes(String parameterName, byte[] x) throws SQLException { 375 376 throw new UnsupportedOperationException (); 377 } 378 379 public void setDate(String parameterName, Date x) throws SQLException { 380 381 throw new UnsupportedOperationException (); 382 } 383 384 public void setTime(String parameterName, Time x) throws SQLException { 385 386 throw new UnsupportedOperationException (); 387 } 388 389 public void setTimestamp(String parameterName, Timestamp x) throws SQLException { 390 391 throw new UnsupportedOperationException (); 392 } 393 394 public void setAsciiStream(String parameterName, InputStream x, int length) 395 throws SQLException { 396 throw new UnsupportedOperationException (); 397 } 398 399 public void setBinaryStream(String parameterName, InputStream x, int length) 400 throws SQLException { 401 throw new UnsupportedOperationException (); 402 } 403 404 public void setObject(String parameterName, Object x, int targetSqlType, int scale) 405 throws SQLException { 406 throw new UnsupportedOperationException (); 407 } 408 409 public void setObject(String parameterName, Object x, int targetSqlType) 410 throws SQLException { 411 throw new UnsupportedOperationException (); 412 } 413 414 public void setObject(String parameterName, Object x) throws SQLException { 415 416 throw new UnsupportedOperationException (); 417 } 418 419 public void setCharacterStream(String parameterName, Reader reader, int length) 420 throws SQLException { 421 throw new UnsupportedOperationException (); 422 } 423 424 public void setDate(String parameterName, Date x, Calendar cal) throws SQLException { 425 426 throw new UnsupportedOperationException (); 427 } 428 429 public void setTime(String parameterName, Time x, Calendar cal) throws SQLException { 430 431 throw new UnsupportedOperationException (); 432 } 433 434 public void setTimestamp(String parameterName, Timestamp x, Calendar cal) 435 throws SQLException { 436 437 throw new UnsupportedOperationException (); 438 } 439 440 public void setNull(String parameterName, int sqlType, String typeName) 441 throws SQLException { 442 throw new UnsupportedOperationException (); 443 } 444 445 public String getString(String parameterName) throws SQLException { 446 try { 447 CallableStatement cstmt = (CallableStatement) this.stmt; 448 return (cstmt.getString(parameterName)); 449 } catch (SQLException se) { 450 throw se; 451 } 452 } 453 454 public boolean getBoolean(String parameterName) throws SQLException { 455 try { 456 CallableStatement cstmt = (CallableStatement) this.stmt; 457 return (cstmt.getBoolean(parameterName)); 458 } catch (SQLException se) { 459 throw se; 460 } 461 } 462 463 public byte getByte(String parameterName) throws SQLException { 464 try { 465 CallableStatement cstmt = (CallableStatement) this.stmt; 466 return (cstmt.getByte(parameterName)); 467 } catch (SQLException se) { 468 throw se; 469 } 470 } 471 472 public short getShort(String parameterName) throws SQLException { 473 try { 474 CallableStatement cstmt = (CallableStatement) this.stmt; 475 return (cstmt.getShort(parameterName)); 476 } catch (SQLException se) { 477 throw se; 478 } 479 } 480 481 public int getInt(String parameterName) throws SQLException { 482 try { 483 CallableStatement cstmt = (CallableStatement) this.stmt; 484 return (cstmt.getInt(parameterName)); 485 } catch (SQLException se) { 486 throw se; 487 } 488 } 489 490 public long getLong(String parameterName) throws SQLException { 491 try { 492 CallableStatement cstmt = (CallableStatement) this.stmt; 493 return (cstmt.getLong(parameterName)); 494 } catch (SQLException se) { 495 throw se; 496 } 497 } 498 499 public float getFloat(String parameterName) throws SQLException { 500 try { 501 CallableStatement cstmt = (CallableStatement) this.stmt; 502 return (cstmt.getFloat(parameterName)); 503 } catch (SQLException se) { 504 throw se; 505 } 506 } 507 508 public double getDouble(String parameterName) throws SQLException { 509 try { 510 CallableStatement cstmt = (CallableStatement) this.stmt; 511 return (cstmt.getDouble(parameterName)); 512 } catch (SQLException se) { 513 throw se; 514 } 515 } 516 517 public byte[] getBytes(String parameterName) throws SQLException { 518 try { 519 CallableStatement cstmt = (CallableStatement) this.stmt; 520 return (cstmt.getBytes(parameterName)); 521 } catch (SQLException se) { 522 throw se; 523 } 524 } 525 526 public Date getDate(String parameterName) throws SQLException { 527 try { 528 CallableStatement cstmt = (CallableStatement) this.stmt; 529 return (cstmt.getDate(parameterName)); 530 } catch (SQLException se) { 531 throw se; 532 } 533 } 534 535 public Time getTime(String parameterName) throws SQLException { 536 try { 537 CallableStatement cstmt = (CallableStatement) this.stmt; 538 return (cstmt.getTime(parameterName)); 539 } catch (SQLException se) { 540 throw se; 541 } 542 } 543 544 public Timestamp getTimestamp(String parameterName) throws SQLException { 545 try { 546 CallableStatement cstmt = (CallableStatement) this.stmt; 547 return (cstmt.getTimestamp(parameterName)); 548 } catch (SQLException se) { 549 throw se; 550 } 551 } 552 553 public Object getObject(String parameterName) throws SQLException { 554 try { 555 CallableStatement cstmt = (CallableStatement) this.stmt; 556 return (cstmt.getObject(parameterName)); 557 } catch (SQLException se) { 558 throw se; 559 } 560 } 561 562 public BigDecimal getBigDecimal(String parameterName) throws SQLException { 563 try { 564 CallableStatement cstmt = (CallableStatement) this.stmt; 565 return (cstmt.getBigDecimal(parameterName)); 566 } catch (SQLException se) { 567 throw se; 568 } 569 } 570 571 public Object getObject(String parameterName, Map map) throws SQLException { 572 try { 573 CallableStatement cstmt = (CallableStatement) this.stmt; 574 return (cstmt.getObject(parameterName,map)); 575 } catch (SQLException se) { 576 throw se; 577 } 578 } 579 580 public Ref getRef(String parameterName) throws SQLException { 581 try { 582 CallableStatement cstmt = (CallableStatement) this.stmt; 583 return (cstmt.getRef(parameterName)); 584 } catch (SQLException se) { 585 throw se; 586 } 587 } 588 589 public Blob getBlob(String parameterName) throws SQLException { 590 try { 591 CallableStatement cstmt = (CallableStatement) this.stmt; 592 return (cstmt.getBlob(parameterName)); 593 } catch (SQLException se) { 594 throw se; 595 } 596 } 597 598 public Clob getClob(String parameterName) throws SQLException { 599 try { 600 CallableStatement cstmt = (CallableStatement) this.stmt; 601 return (cstmt.getClob(parameterName)); 602 } catch (SQLException se) { 603 throw se; 604 } 605 } 606 607 public Array getArray(String parameterName) throws SQLException { 608 try { 609 CallableStatement cstmt = (CallableStatement) this.stmt; 610 return (cstmt.getArray(parameterName)); 611 } catch (SQLException se) { 612 throw se; 613 } 614 } 615 616 public Date getDate(String parameterName, Calendar cal) throws SQLException { 617 try { 618 CallableStatement cstmt = (CallableStatement) this.stmt; 619 return (cstmt.getDate(parameterName,cal)); 620 } catch (SQLException se) { 621 throw se; 622 } 623 } 624 625 public Time getTime(String parameterName, Calendar cal) throws SQLException { 626 try { 627 CallableStatement cstmt = (CallableStatement) this.stmt; 628 return (cstmt.getTime(parameterName,cal)); 629 } catch (SQLException se) { 630 throw se; 631 } 632 } 633 634 public Timestamp getTimestamp(String parameterName, Calendar cal) 635 throws SQLException { 636 try { 637 CallableStatement cstmt = (CallableStatement) this.stmt; 638 return (cstmt.getTimestamp(parameterName,cal)); 639 } catch (SQLException se) { 640 throw se; 641 } 642 } 643 644 public URL getURL(String parameterName) throws SQLException { 645 try { 646 CallableStatement cstmt = (CallableStatement) this.stmt; 647 return (cstmt.getURL(parameterName)); 648 } catch (SQLException se) { 649 throw se; 650 } 651 } 652 653 655 } 656 | Popular Tags |