1 package org.hibernate.jdbc; 3 4 import java.io.InputStream ; 5 import java.io.Reader ; 6 import java.math.BigDecimal ; 7 import java.net.URL ; 8 import java.sql.Array ; 9 import java.sql.Blob ; 10 import java.sql.Clob ; 11 import java.sql.Date ; 12 import java.sql.Ref ; 13 import java.sql.ResultSet ; 14 import java.sql.ResultSetMetaData ; 15 import java.sql.SQLException ; 16 import java.sql.SQLWarning ; 17 import java.sql.Statement ; 18 import java.sql.Time ; 19 import java.sql.Timestamp ; 20 import java.util.Calendar ; 21 import java.util.Map ; 22 23 30 public class ResultSetWrapper implements ResultSet { 31 32 private ResultSet rs; 33 private ColumnNameCache columnNameCache; 34 35 public ResultSetWrapper(ResultSet resultSet, ColumnNameCache columnNameCache) { 36 this.rs = resultSet; 37 this.columnNameCache = columnNameCache; 38 } 39 40 ResultSet getTarget() { 41 return rs; 42 } 43 44 45 47 60 public int findColumn(String columnName) throws SQLException { 61 return columnNameCache.getIndexForColumnName( columnName, this ); 62 } 63 64 public Array getArray(String colName) throws SQLException { 65 return rs.getArray( findColumn(colName) ); 66 } 67 68 public void updateArray(String columnName, Array x) throws SQLException { 69 rs.updateArray( findColumn(columnName), x ); 70 } 71 72 public InputStream getAsciiStream(String columnName) throws SQLException { 73 return rs.getAsciiStream( findColumn(columnName) ); 74 } 75 76 public void updateAsciiStream(String columnName, InputStream x, int length) throws SQLException { 77 rs.updateAsciiStream( findColumn(columnName), x, length ); 78 } 79 80 public BigDecimal getBigDecimal(String columnName) throws SQLException { 81 return rs.getBigDecimal( findColumn(columnName) ); 82 } 83 84 public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException { 85 return rs.getBigDecimal( findColumn(columnName), scale ); 86 } 87 88 public void updateBigDecimal(String columnName, BigDecimal x) throws SQLException { 89 rs.updateBigDecimal( findColumn(columnName), x ); 90 } 91 92 public InputStream getBinaryStream(String columnName) throws SQLException { 93 return rs.getBinaryStream( findColumn(columnName) ); 94 } 95 96 public void updateBinaryStream(String columnName, InputStream x, int length) throws SQLException { 97 rs.updateBinaryStream( findColumn(columnName), x, length ); 98 } 99 100 public Blob getBlob(String columnName) throws SQLException { 101 return rs.getBlob( findColumn(columnName) ); 102 } 103 104 public void updateBlob(String columnName, Blob x) throws SQLException { 105 rs.updateBlob( findColumn(columnName), x ); 106 } 107 108 public boolean getBoolean(String columnName) throws SQLException { 109 return rs.getBoolean( findColumn(columnName) ); 110 } 111 112 public void updateBoolean(String columnName, boolean x) throws SQLException { 113 rs.updateBoolean( findColumn(columnName), x ); 114 } 115 116 public byte getByte(String columnName) throws SQLException { 117 return rs.getByte( findColumn(columnName) ); 118 } 119 120 public void updateByte(String columnName, byte x) throws SQLException { 121 rs.updateByte( findColumn(columnName), x ); 122 } 123 124 public byte[] getBytes(String columnName) throws SQLException { 125 return rs.getBytes( findColumn(columnName) ); 126 } 127 128 public void updateBytes(String columnName, byte[] x) throws SQLException { 129 rs.updateBytes( findColumn(columnName), x ); 130 } 131 132 public Reader getCharacterStream(String columnName) throws SQLException { 133 return rs.getCharacterStream( findColumn(columnName) ); 134 } 135 136 public void updateCharacterStream(String columnName, Reader x, int length) throws SQLException { 137 rs.updateCharacterStream( findColumn(columnName), x, length ); 138 } 139 140 public Clob getClob(String columnName) throws SQLException { 141 return rs.getClob( findColumn(columnName) ); 142 } 143 144 public void updateClob(String columnName, Clob x) throws SQLException { 145 rs.updateClob( findColumn(columnName), x ); 146 } 147 148 public Date getDate(String columnName) throws SQLException { 149 return rs.getDate( findColumn(columnName) ); 150 } 151 152 public Date getDate(String columnName, Calendar cal) throws SQLException { 153 return rs.getDate( findColumn(columnName), cal ); 154 } 155 156 public void updateDate(String columnName, Date x) throws SQLException { 157 rs.updateDate( findColumn(columnName), x ); 158 } 159 160 public double getDouble(String columnName) throws SQLException { 161 return rs.getDouble( findColumn(columnName) ); 162 } 163 164 public void updateDouble(String columnName, double x) throws SQLException { 165 rs.updateDouble( findColumn(columnName), x ); 166 } 167 168 public float getFloat(String columnName) throws SQLException { 169 return rs.getFloat( findColumn(columnName) ); 170 } 171 172 public void updateFloat(String columnName, float x) throws SQLException { 173 rs.updateFloat( findColumn(columnName), x ); 174 } 175 176 public int getInt(String columnName) throws SQLException { 177 return rs.getInt( findColumn(columnName) ); 178 } 179 180 public void updateInt(String columnName, int x) throws SQLException { 181 rs.updateInt( findColumn(columnName), x ); 182 } 183 184 public long getLong(String columnName) throws SQLException { 185 return rs.getLong( findColumn(columnName) ); 186 } 187 188 public void updateLong(String columnName, long x) throws SQLException { 189 rs.updateLong( findColumn(columnName), x ); 190 } 191 192 public Object getObject(String columnName) throws SQLException { 193 return rs.getObject( findColumn(columnName) ); 194 } 195 196 public Object getObject(String columnName, Map map) throws SQLException { 197 return rs.getObject( findColumn(columnName), map ); 198 } 199 200 public void updateObject(String columnName, Object x) throws SQLException { 201 rs.updateObject( findColumn(columnName), x ); 202 } 203 204 public void updateObject(String columnName, Object x, int scale) throws SQLException { 205 rs.updateObject( findColumn(columnName), x, scale ); 206 } 207 208 public Ref getRef(String columnName) throws SQLException { 209 return rs.getRef( findColumn(columnName) ); 210 } 211 212 public void updateRef(String columnName, Ref x) throws SQLException { 213 rs.updateRef( findColumn(columnName), x ); 214 } 215 216 public short getShort(String columnName) throws SQLException { 217 return rs.getShort( findColumn(columnName) ); 218 } 219 220 public void updateShort(String columnName, short x) throws SQLException { 221 rs.updateShort( findColumn(columnName), x ); 222 } 223 224 public String getString(String columnName) throws SQLException { 225 return rs.getString( findColumn(columnName) ); 226 } 227 228 public void updateString(String columnName, String x) throws SQLException { 229 rs.updateString( findColumn(columnName), x ); 230 } 231 232 public Time getTime(String columnName) throws SQLException { 233 return rs.getTime( findColumn(columnName) ); 234 } 235 236 public Time getTime(String columnName, Calendar cal) throws SQLException { 237 return rs.getTime( findColumn(columnName), cal ); 238 } 239 240 public void updateTime(String columnName, Time x) throws SQLException { 241 rs.updateTime( findColumn(columnName), x ); 242 } 243 244 public Timestamp getTimestamp(String columnName) throws SQLException { 245 return rs.getTimestamp( findColumn(columnName) ); 246 } 247 248 public void updateTimestamp(String columnName, Timestamp x) throws SQLException { 249 rs.updateTimestamp( findColumn(columnName), x ); 250 } 251 252 public Timestamp getTimestamp(String columnName, Calendar cal) throws SQLException { 253 return rs.getTimestamp( findColumn(columnName), cal ); 254 } 255 256 public InputStream getUnicodeStream(String columnName) throws SQLException { 257 return rs.getUnicodeStream( findColumn(columnName) ); 258 } 259 260 public URL getURL(String columnName) throws SQLException { 261 return rs.getURL( findColumn(columnName) ); 262 } 263 264 public void updateNull(String columnName) throws SQLException { 265 rs.updateNull( findColumn(columnName) ); 266 } 267 268 269 271 public int getConcurrency() throws SQLException { 272 return rs.getConcurrency(); 273 } 274 275 public int getFetchDirection() throws SQLException { 276 return rs.getFetchDirection(); 277 } 278 279 public int getFetchSize() throws SQLException { 280 return rs.getFetchSize(); 281 } 282 283 public int getRow() throws SQLException { 284 return rs.getRow(); 285 } 286 287 public int getType() throws SQLException { 288 return rs.getType(); 289 } 290 291 public void afterLast() throws SQLException { 292 rs.afterLast(); 293 } 294 295 public void beforeFirst() throws SQLException { 296 rs.beforeFirst(); 297 } 298 299 public void cancelRowUpdates() throws SQLException { 300 rs.cancelRowUpdates(); 301 } 302 303 public void clearWarnings() throws SQLException { 304 rs.clearWarnings(); 305 } 306 307 public void close() throws SQLException { 308 rs.close(); 309 } 310 311 public void deleteRow() throws SQLException { 312 rs.deleteRow(); 313 } 314 315 public void insertRow() throws SQLException { 316 rs.insertRow(); 317 } 318 319 public void moveToCurrentRow() throws SQLException { 320 rs.moveToCurrentRow(); 321 } 322 323 public void moveToInsertRow() throws SQLException { 324 rs.moveToInsertRow(); 325 } 326 327 public void refreshRow() throws SQLException { 328 rs.refreshRow(); 329 } 330 331 public void updateRow() throws SQLException { 332 rs.updateRow(); 333 } 334 335 public boolean first() throws SQLException { 336 return rs.first(); 337 } 338 339 public boolean isAfterLast() throws SQLException { 340 return rs.isAfterLast(); 341 } 342 343 public boolean isBeforeFirst() throws SQLException { 344 return rs.isBeforeFirst(); 345 } 346 347 public boolean isFirst() throws SQLException { 348 return rs.isFirst(); 349 } 350 351 public boolean isLast() throws SQLException { 352 return rs.isLast(); 353 } 354 355 public boolean last() throws SQLException { 356 return rs.last(); 357 } 358 359 public boolean next() throws SQLException { 360 return rs.next(); 361 } 362 363 public boolean previous() throws SQLException { 364 return rs.previous(); 365 } 366 367 public boolean rowDeleted() throws SQLException { 368 return rs.rowDeleted(); 369 } 370 371 public boolean rowInserted() throws SQLException { 372 return rs.rowInserted(); 373 } 374 375 public boolean rowUpdated() throws SQLException { 376 return rs.rowUpdated(); 377 } 378 379 public boolean wasNull() throws SQLException { 380 return rs.wasNull(); 381 } 382 383 public byte getByte(int columnIndex) throws SQLException { 384 return rs.getByte(columnIndex); 385 } 386 387 public double getDouble(int columnIndex) throws SQLException { 388 return rs.getDouble(columnIndex); 389 } 390 391 public float getFloat(int columnIndex) throws SQLException { 392 return rs.getFloat(columnIndex); 393 } 394 395 public int getInt(int columnIndex) throws SQLException { 396 return rs.getInt(columnIndex); 397 } 398 399 public long getLong(int columnIndex) throws SQLException { 400 return rs.getLong(columnIndex); 401 } 402 403 public short getShort(int columnIndex) throws SQLException { 404 return rs.getShort(columnIndex); 405 } 406 407 public void setFetchDirection(int direction) throws SQLException { 408 rs.setFetchDirection(direction); 409 } 410 411 public void setFetchSize(int rows) throws SQLException { 412 rs.setFetchSize(rows); 413 } 414 415 public void updateNull(int columnIndex) throws SQLException { 416 rs.updateNull(columnIndex); 417 } 418 419 public boolean absolute(int row) throws SQLException { 420 return rs.absolute(row); 421 } 422 423 public boolean getBoolean(int columnIndex) throws SQLException { 424 return rs.getBoolean(columnIndex); 425 } 426 427 public boolean relative(int rows) throws SQLException { 428 return rs.relative(rows); 429 } 430 431 public byte[] getBytes(int columnIndex) throws SQLException { 432 return rs.getBytes(columnIndex); 433 } 434 435 public void updateByte(int columnIndex, byte x) throws SQLException { 436 rs.updateByte(columnIndex, x); 437 } 438 439 public void updateDouble(int columnIndex, double x) throws SQLException { 440 rs.updateDouble(columnIndex, x); 441 } 442 443 public void updateFloat(int columnIndex, float x) throws SQLException { 444 rs.updateFloat(columnIndex, x); 445 } 446 447 public void updateInt(int columnIndex, int x) throws SQLException { 448 rs.updateInt(columnIndex, x); 449 } 450 451 public void updateLong(int columnIndex, long x) throws SQLException { 452 rs.updateLong(columnIndex, x); 453 } 454 455 public void updateShort(int columnIndex, short x) throws SQLException { 456 rs.updateShort(columnIndex, x); 457 } 458 459 public void updateBoolean(int columnIndex, boolean x) throws SQLException { 460 rs.updateBoolean(columnIndex, x); 461 } 462 463 public void updateBytes(int columnIndex, byte[] x) throws SQLException { 464 rs.updateBytes(columnIndex, x); 465 } 466 467 public InputStream getAsciiStream(int columnIndex) throws SQLException { 468 return rs.getAsciiStream(columnIndex); 469 } 470 471 public InputStream getBinaryStream(int columnIndex) throws SQLException { 472 return rs.getBinaryStream(columnIndex); 473 } 474 475 public InputStream getUnicodeStream(int columnIndex) throws SQLException { 476 return rs.getUnicodeStream(columnIndex); 477 } 478 479 public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException { 480 rs.updateAsciiStream(columnIndex, x, length); 481 } 482 483 public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException { 484 rs.updateBinaryStream(columnIndex, x, length); 485 } 486 487 public Reader getCharacterStream(int columnIndex) throws SQLException { 488 return rs.getCharacterStream(columnIndex); 489 } 490 491 public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException { 492 rs.updateCharacterStream(columnIndex, x, length); 493 } 494 495 public Object getObject(int columnIndex) throws SQLException { 496 return rs.getObject(columnIndex); 497 } 498 499 public void updateObject(int columnIndex, Object x) throws SQLException { 500 rs.updateObject(columnIndex, x); 501 } 502 503 public void updateObject(int columnIndex, Object x, int scale) throws SQLException { 504 rs.updateObject(columnIndex, x, scale); 505 } 506 507 public String getCursorName() throws SQLException { 508 return rs.getCursorName(); 509 } 510 511 public String getString(int columnIndex) throws SQLException { 512 return rs.getString(columnIndex); 513 } 514 515 public void updateString(int columnIndex, String x) throws SQLException { 516 rs.updateString(columnIndex, x); 517 } 518 519 public BigDecimal getBigDecimal(int columnIndex) throws SQLException { 520 return rs.getBigDecimal(columnIndex); 521 } 522 523 public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { 524 return rs.getBigDecimal(columnIndex, scale); 525 } 526 527 public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { 528 rs.updateBigDecimal(columnIndex, x); 529 } 530 531 public URL getURL(int columnIndex) throws SQLException { 532 return rs.getURL(columnIndex); 533 } 534 535 public Array getArray(int columnIndex) throws SQLException { 536 return rs.getArray(columnIndex); 537 } 538 539 public void updateArray(int columnIndex, Array x) throws SQLException { 540 rs.updateArray(columnIndex, x); 541 } 542 543 public Blob getBlob(int columnIndex) throws SQLException { 544 return rs.getBlob(columnIndex); 545 } 546 547 public void updateBlob(int columnIndex, Blob x) throws SQLException { 548 rs.updateBlob(columnIndex, x); 549 } 550 551 public Clob getClob(int columnIndex) throws SQLException { 552 return rs.getClob(columnIndex); 553 } 554 555 public void updateClob(int columnIndex, Clob x) throws SQLException { 556 rs.updateClob(columnIndex, x); 557 } 558 559 public Date getDate(int columnIndex) throws SQLException { 560 return rs.getDate(columnIndex); 561 } 562 563 public void updateDate(int columnIndex, Date x) throws SQLException { 564 rs.updateDate(columnIndex, x); 565 } 566 567 public Ref getRef(int columnIndex) throws SQLException { 568 return rs.getRef(columnIndex); 569 } 570 571 public void updateRef(int columnIndex, Ref x) throws SQLException { 572 rs.updateRef(columnIndex, x); 573 } 574 575 public ResultSetMetaData getMetaData() throws SQLException { 576 return rs.getMetaData(); 577 } 578 579 public SQLWarning getWarnings() throws SQLException { 580 return rs.getWarnings(); 581 } 582 583 public Statement getStatement() throws SQLException { 584 return rs.getStatement(); 585 } 586 587 public Time getTime(int columnIndex) throws SQLException { 588 return rs.getTime(columnIndex); 589 } 590 591 public void updateTime(int columnIndex, Time x) throws SQLException { 592 rs.updateTime(columnIndex, x); 593 } 594 595 public Timestamp getTimestamp(int columnIndex) throws SQLException { 596 return rs.getTimestamp(columnIndex); 597 } 598 599 public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException { 600 rs.updateTimestamp(columnIndex, x); 601 } 602 603 public Object getObject(int columnIndex, Map map) throws SQLException { 604 return rs.getObject( columnIndex, map ); 605 } 606 607 public Date getDate(int columnIndex, Calendar cal) throws SQLException { 608 return rs.getDate(columnIndex, cal); 609 } 610 611 public Time getTime(int columnIndex, Calendar cal) throws SQLException { 612 return rs.getTime(columnIndex, cal); 613 } 614 615 public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { 616 return rs.getTimestamp(columnIndex, cal); 617 } 618 } 619 620 | Popular Tags |