ResultSetWrappingSqlRowSet.java 17.5 KB
Newer Older
A
Arjen Poutsma 已提交
1
/*
2
 * Copyright 2002-2014 the original author or authors.
A
Arjen Poutsma 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.jdbc.support.rowset;

import java.math.BigDecimal;
import java.sql.Date;
import java.sql.ResultSet;
22
import java.sql.ResultSetMetaData;
A
Arjen Poutsma 已提交
23 24 25 26
import java.sql.SQLException;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Calendar;
J
Juergen Hoeller 已提交
27
import java.util.Collections;
28
import java.util.HashMap;
A
Arjen Poutsma 已提交
29 30 31 32 33 34 35
import java.util.Map;

import org.springframework.jdbc.InvalidResultSetAccessException;

/**
 * Default implementation of Spring's {@link SqlRowSet} interface.
 *
36
 * <p>This implementation wraps a {@code javax.sql.ResultSet}, catching any SQLExceptions
J
Juergen Hoeller 已提交
37
 * and translating them to the appropriate Spring {@link InvalidResultSetAccessException}.
A
Arjen Poutsma 已提交
38
 *
J
Juergen Hoeller 已提交
39 40
 * <p>The passed-in ResultSets should already be disconnected if the SqlRowSet is supposed
 * to be usable in a disconnected fashion. This means that you will usually pass in a
41
 * {@code javax.sql.rowset.CachedRowSet}, which implements the ResultSet interface.
A
Arjen Poutsma 已提交
42
 *
J
Juergen Hoeller 已提交
43 44 45 46
 * <p>Note: Since JDBC 4.0, it has been clarified that any methods using a String to identify
 * the column should be using the column label. The column label is assigned using the ALIAS
 * keyword in the SQL query string. When the query doesn't use an ALIAS, the default label is
 * the column name. Most JDBC ResultSet implementations follow this new pattern but there are
47
 * exceptions such as the {@code com.sun.rowset.CachedRowSetImpl} class which only uses
J
Juergen Hoeller 已提交
48 49
 * the column name, ignoring any column labels. As of Spring 3.0.5, ResultSetWrappingSqlRowSet
 * will translate column labels to the correct column index to provide better support for the
50
 * {@code com.sun.rowset.CachedRowSetImpl} which is the default implementation used by
J
Juergen Hoeller 已提交
51 52
 * {@link org.springframework.jdbc.core.JdbcTemplate} when working with RowSets.
 *
53
 * <p>Note: This class implements the {@code java.io.Serializable} marker interface
J
Juergen Hoeller 已提交
54 55 56
 * through the SqlRowSet interface, but is only actually serializable if the disconnected
 * ResultSet/RowSet contained in it is serializable. Most CachedRowSet implementations
 * are actually serializable, so this should usually work out.
A
Arjen Poutsma 已提交
57 58 59 60 61 62
 *
 * @author Thomas Risberg
 * @author Juergen Hoeller
 * @since 1.2
 * @see java.sql.ResultSet
 * @see javax.sql.rowset.CachedRowSet
J
Juergen Hoeller 已提交
63
 * @see org.springframework.jdbc.core.JdbcTemplate#queryForRowSet
A
Arjen Poutsma 已提交
64 65 66 67 68 69 70 71 72 73
 */
public class ResultSetWrappingSqlRowSet implements SqlRowSet {

	/** use serialVersionUID from Spring 1.2 for interoperability */
	private static final long serialVersionUID = -4688694393146734764L;


	private final ResultSet resultSet;

	private final SqlRowSetMetaData rowSetMetaData;
74

75
	private final Map<String, Integer> columnLabelMap;
A
Arjen Poutsma 已提交
76 77 78 79 80


	/**
	 * Create a new ResultSetWrappingSqlRowSet for the given ResultSet.
	 * @param resultSet a disconnected ResultSet to wrap
81
	 * (usually a {@code javax.sql.rowset.CachedRowSet})
A
Arjen Poutsma 已提交
82 83 84 85 86 87 88 89 90 91 92 93 94 95
	 * @throws InvalidResultSetAccessException if extracting
	 * the ResultSetMetaData failed
	 * @see javax.sql.rowset.CachedRowSet
	 * @see java.sql.ResultSet#getMetaData
	 * @see ResultSetWrappingSqlRowSetMetaData
	 */
	public ResultSetWrappingSqlRowSet(ResultSet resultSet) throws InvalidResultSetAccessException {
		this.resultSet = resultSet;
		try {
			this.rowSetMetaData = new ResultSetWrappingSqlRowSetMetaData(resultSet.getMetaData());
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
96 97 98 99 100 101
		try {
			ResultSetMetaData rsmd = resultSet.getMetaData();
			if (rsmd != null) {
				int columnCount = rsmd.getColumnCount();
				this.columnLabelMap = new HashMap<String, Integer>(columnCount);
				for (int i = 1; i <= columnCount; i++) {
102 103 104 105 106 107
					String key = rsmd.getColumnLabel(i);
					// Make sure to preserve first matching column for any given name,
					// as defined in ResultSet's type-level javadoc (lines 81 to 83).
					if (!this.columnLabelMap.containsKey(key)) {
						this.columnLabelMap.put(key, i);
					}
108 109 110
				}
			}
			else {
J
Juergen Hoeller 已提交
111
				this.columnLabelMap = Collections.emptyMap();
112
			}
J
Juergen Hoeller 已提交
113 114
		}
		catch (SQLException se) {
115 116
			throw new InvalidResultSetAccessException(se);
		}
117

A
Arjen Poutsma 已提交
118 119 120 121 122
	}


	/**
	 * Return the underlying ResultSet
123
	 * (usually a {@code javax.sql.rowset.CachedRowSet}).
A
Arjen Poutsma 已提交
124 125 126 127 128 129 130 131 132
	 * @see javax.sql.rowset.CachedRowSet
	 */
	public final ResultSet getResultSet() {
		return this.resultSet;
	}

	/**
	 * @see java.sql.ResultSetMetaData#getCatalogName(int)
	 */
133
	@Override
A
Arjen Poutsma 已提交
134 135 136
	public final SqlRowSetMetaData getMetaData() {
		return this.rowSetMetaData;
	}
137

A
Arjen Poutsma 已提交
138 139 140
	/**
	 * @see java.sql.ResultSet#findColumn(String)
	 */
141
	@Override
142
	public int findColumn(String columnLabel) throws InvalidResultSetAccessException {
J
Juergen Hoeller 已提交
143 144 145 146 147
		Integer columnIndex = this.columnLabelMap.get(columnLabel);
		if (columnIndex != null) {
			return columnIndex;
		}
		else {
148
			try {
J
Juergen Hoeller 已提交
149
				return this.resultSet.findColumn(columnLabel);
150
			}
151 152 153
			catch (SQLException se) {
				throw new InvalidResultSetAccessException(se);
			}
A
Arjen Poutsma 已提交
154 155 156 157 158 159 160 161 162
		}
	}


	// RowSet methods for extracting data values

	/**
	 * @see java.sql.ResultSet#getBigDecimal(int)
	 */
163
	@Override
A
Arjen Poutsma 已提交
164 165 166 167 168 169 170 171
	public BigDecimal getBigDecimal(int columnIndex) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getBigDecimal(columnIndex);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
172

A
Arjen Poutsma 已提交
173 174 175
	/**
	 * @see java.sql.ResultSet#getBigDecimal(String)
	 */
176
	@Override
177 178
	public BigDecimal getBigDecimal(String columnLabel) throws InvalidResultSetAccessException {
		return getBigDecimal(findColumn(columnLabel));
A
Arjen Poutsma 已提交
179 180 181 182 183
	}

	/**
	 * @see java.sql.ResultSet#getBoolean(int)
	 */
184
	@Override
A
Arjen Poutsma 已提交
185 186 187 188 189 190 191 192 193 194 195 196
	public boolean getBoolean(int columnIndex) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getBoolean(columnIndex);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}

	/**
	 * @see java.sql.ResultSet#getBoolean(String)
	 */
197
	@Override
198 199
	public boolean getBoolean(String columnLabel) throws InvalidResultSetAccessException {
		return getBoolean(findColumn(columnLabel));
A
Arjen Poutsma 已提交
200
	}
201

A
Arjen Poutsma 已提交
202 203 204
	/**
	 * @see java.sql.ResultSet#getByte(int)
	 */
205
	@Override
A
Arjen Poutsma 已提交
206 207 208 209 210 211 212 213
	public byte getByte(int columnIndex) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getByte(columnIndex);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
214

A
Arjen Poutsma 已提交
215 216 217
	/**
	 * @see java.sql.ResultSet#getByte(String)
	 */
218
	@Override
219 220
	public byte getByte(String columnLabel) throws InvalidResultSetAccessException {
		return getByte(findColumn(columnLabel));
A
Arjen Poutsma 已提交
221
	}
222

A
Arjen Poutsma 已提交
223 224 225
	/**
	 * @see java.sql.ResultSet#getDate(int, java.util.Calendar)
	 */
226
	@Override
A
Arjen Poutsma 已提交
227 228 229 230 231 232 233 234
	public Date getDate(int columnIndex, Calendar cal) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getDate(columnIndex, cal);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
235

A
Arjen Poutsma 已提交
236 237 238
	/**
	 * @see java.sql.ResultSet#getDate(int)
	 */
239
	@Override
A
Arjen Poutsma 已提交
240 241 242 243 244 245 246 247 248 249 250
	public Date getDate(int columnIndex) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getDate(columnIndex);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
	/**
	 * @see java.sql.ResultSet#getDate(String, java.util.Calendar)
	 */
251
	@Override
252 253
	public Date getDate(String columnLabel, Calendar cal) throws InvalidResultSetAccessException {
		return getDate(findColumn(columnLabel), cal);
A
Arjen Poutsma 已提交
254
	}
255

A
Arjen Poutsma 已提交
256 257 258
	/**
	 * @see java.sql.ResultSet#getDate(String)
	 */
259
	@Override
260 261
	public Date getDate(String columnLabel) throws InvalidResultSetAccessException {
		return getDate(findColumn(columnLabel));
A
Arjen Poutsma 已提交
262
	}
263

A
Arjen Poutsma 已提交
264 265 266
	/**
	 * @see java.sql.ResultSet#getDouble(int)
	 */
267
	@Override
A
Arjen Poutsma 已提交
268 269 270 271 272 273 274 275
	public double getDouble(int columnIndex) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getDouble(columnIndex);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
276

A
Arjen Poutsma 已提交
277 278 279
	/**
	 * @see java.sql.ResultSet#getDouble(String)
	 */
280
	@Override
281 282
	public double getDouble(String columnLabel) throws InvalidResultSetAccessException {
		return getDouble(findColumn(columnLabel));
A
Arjen Poutsma 已提交
283
	}
284

A
Arjen Poutsma 已提交
285 286 287
	/**
	 * @see java.sql.ResultSet#getFloat(int)
	 */
288
	@Override
A
Arjen Poutsma 已提交
289 290 291 292 293 294 295 296 297 298 299 300
	public float getFloat(int columnIndex) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getFloat(columnIndex);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}

	/**
	 * @see java.sql.ResultSet#getFloat(String)
	 */
301
	@Override
302 303
	public float getFloat(String columnLabel) throws InvalidResultSetAccessException {
		return getFloat(findColumn(columnLabel));
A
Arjen Poutsma 已提交
304 305 306 307
	}
	/**
	 * @see java.sql.ResultSet#getInt(int)
	 */
308
	@Override
A
Arjen Poutsma 已提交
309 310 311 312 313 314 315 316 317 318 319 320
	public int getInt(int columnIndex) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getInt(columnIndex);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}

	/**
	 * @see java.sql.ResultSet#getInt(String)
	 */
321
	@Override
322 323
	public int getInt(String columnLabel) throws InvalidResultSetAccessException {
		return getInt(findColumn(columnLabel));
A
Arjen Poutsma 已提交
324
	}
325

A
Arjen Poutsma 已提交
326 327 328
	/**
	 * @see java.sql.ResultSet#getLong(int)
	 */
329
	@Override
A
Arjen Poutsma 已提交
330 331 332 333 334 335 336 337
	public long getLong(int columnIndex) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getLong(columnIndex);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
338

A
Arjen Poutsma 已提交
339 340 341
	/**
	 * @see java.sql.ResultSet#getLong(String)
	 */
342
	@Override
343 344
	public long getLong(String columnLabel) throws InvalidResultSetAccessException {
		return getLong(findColumn(columnLabel));
A
Arjen Poutsma 已提交
345
	}
346

A
Arjen Poutsma 已提交
347 348 349
	/**
	 * @see java.sql.ResultSet#getObject(int, java.util.Map)
	 */
350
	@Override
351
	public Object getObject(int i,  Map<String, Class<?>> map) throws InvalidResultSetAccessException {
A
Arjen Poutsma 已提交
352 353 354 355 356 357 358
		try {
			return this.resultSet.getObject(i, map);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
359

A
Arjen Poutsma 已提交
360 361 362
	/**
	 * @see java.sql.ResultSet#getObject(int)
	 */
363
	@Override
A
Arjen Poutsma 已提交
364 365 366 367 368 369 370 371
	public Object getObject(int columnIndex) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getObject(columnIndex);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
372

A
Arjen Poutsma 已提交
373 374 375
	/**
	 * @see java.sql.ResultSet#getObject(String, java.util.Map)
	 */
376
	@Override
377 378
	public Object getObject(String columnLabel,  Map<String, Class<?>> map) throws InvalidResultSetAccessException {
		return getObject(findColumn(columnLabel), map);
A
Arjen Poutsma 已提交
379
	}
380

A
Arjen Poutsma 已提交
381 382 383
	/**
	 * @see java.sql.ResultSet#getObject(String)
	 */
384
	@Override
385 386
	public Object getObject(String columnLabel) throws InvalidResultSetAccessException {
		return getObject(findColumn(columnLabel));
A
Arjen Poutsma 已提交
387
	}
388

A
Arjen Poutsma 已提交
389 390 391
	/**
	 * @see java.sql.ResultSet#getShort(int)
	 */
392
	@Override
A
Arjen Poutsma 已提交
393 394 395 396 397 398 399 400
	public short getShort(int columnIndex) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getShort(columnIndex);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
401

A
Arjen Poutsma 已提交
402 403 404
	/**
	 * @see java.sql.ResultSet#getShort(String)
	 */
405
	@Override
406 407
	public short getShort(String columnLabel) throws InvalidResultSetAccessException {
		return getShort(findColumn(columnLabel));
A
Arjen Poutsma 已提交
408
	}
409

A
Arjen Poutsma 已提交
410 411 412
	/**
	 * @see java.sql.ResultSet#getString(int)
	 */
413
	@Override
A
Arjen Poutsma 已提交
414 415 416 417 418 419 420 421
	public String getString(int columnIndex) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getString(columnIndex);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
422

A
Arjen Poutsma 已提交
423 424 425
	/**
	 * @see java.sql.ResultSet#getString(String)
	 */
426
	@Override
427 428
	public String getString(String columnLabel) throws InvalidResultSetAccessException {
		return getString(findColumn(columnLabel));
A
Arjen Poutsma 已提交
429
	}
430

A
Arjen Poutsma 已提交
431 432 433
	/**
	 * @see java.sql.ResultSet#getTime(int, java.util.Calendar)
	 */
434
	@Override
A
Arjen Poutsma 已提交
435 436 437 438 439 440 441 442
	public Time getTime(int columnIndex, Calendar cal) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getTime(columnIndex, cal);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
443

A
Arjen Poutsma 已提交
444 445 446
	/**
	 * @see java.sql.ResultSet#getTime(int)
	 */
447
	@Override
A
Arjen Poutsma 已提交
448 449 450 451 452 453 454 455 456 457 458 459
	public Time getTime(int columnIndex) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getTime(columnIndex);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}

	/**
	 * @see java.sql.ResultSet#getTime(String, java.util.Calendar)
	 */
460
	@Override
461 462
	public Time getTime(String columnLabel, Calendar cal) throws InvalidResultSetAccessException {
		return getTime(findColumn(columnLabel), cal);
A
Arjen Poutsma 已提交
463
	}
464

A
Arjen Poutsma 已提交
465 466 467
	/**
	 * @see java.sql.ResultSet#getTime(String)
	 */
468
	@Override
469 470
	public Time getTime(String columnLabel) throws InvalidResultSetAccessException {
		return getTime(findColumn(columnLabel));
A
Arjen Poutsma 已提交
471
	}
472

A
Arjen Poutsma 已提交
473 474 475
	/**
	 * @see java.sql.ResultSet#getTimestamp(int, java.util.Calendar)
	 */
476
	@Override
A
Arjen Poutsma 已提交
477 478 479 480 481 482 483 484
	public Timestamp getTimestamp(int columnIndex, Calendar cal) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getTimestamp(columnIndex, cal);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
485

A
Arjen Poutsma 已提交
486 487 488
	/**
	 * @see java.sql.ResultSet#getTimestamp(int)
	 */
489
	@Override
A
Arjen Poutsma 已提交
490 491 492 493 494 495 496 497 498 499 500 501
	public Timestamp getTimestamp(int columnIndex) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getTimestamp(columnIndex);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}

	/**
	 * @see java.sql.ResultSet#getTimestamp(String, java.util.Calendar)
	 */
502
	@Override
503 504
	public Timestamp getTimestamp(String columnLabel, Calendar cal) throws InvalidResultSetAccessException {
		return getTimestamp(findColumn(columnLabel), cal);
A
Arjen Poutsma 已提交
505 506 507 508 509
	}

	/**
	 * @see java.sql.ResultSet#getTimestamp(String)
	 */
510
	@Override
511 512
	public Timestamp getTimestamp(String columnLabel) throws InvalidResultSetAccessException {
		return getTimestamp(findColumn(columnLabel));
A
Arjen Poutsma 已提交
513 514 515 516
	}


	// RowSet navigation methods
517

A
Arjen Poutsma 已提交
518 519 520
	/**
	 * @see java.sql.ResultSet#absolute(int)
	 */
521
	@Override
A
Arjen Poutsma 已提交
522 523 524 525 526 527 528 529 530 531 532 533
	public boolean absolute(int row) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.absolute(row);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}

	/**
	 * @see java.sql.ResultSet#afterLast()
	 */
534
	@Override
A
Arjen Poutsma 已提交
535 536 537 538 539 540 541 542
	public void afterLast() throws InvalidResultSetAccessException {
		try {
			this.resultSet.afterLast();
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
543

A
Arjen Poutsma 已提交
544 545 546
	/**
	 * @see java.sql.ResultSet#beforeFirst()
	 */
547
	@Override
A
Arjen Poutsma 已提交
548 549 550 551 552 553 554 555
	public void beforeFirst() throws InvalidResultSetAccessException {
		try {
			this.resultSet.beforeFirst();
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
556

A
Arjen Poutsma 已提交
557 558 559
	/**
	 * @see java.sql.ResultSet#first()
	 */
560
	@Override
A
Arjen Poutsma 已提交
561 562 563 564 565 566 567 568 569 570 571 572
	public boolean first() throws InvalidResultSetAccessException {
		try {
			return this.resultSet.first();
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}

	/**
	 * @see java.sql.ResultSet#getRow()
	 */
573
	@Override
A
Arjen Poutsma 已提交
574 575 576 577 578 579 580 581 582 583 584 585
	public int getRow() throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getRow();
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}

	/**
	 * @see java.sql.ResultSet#isAfterLast()
	 */
586
	@Override
A
Arjen Poutsma 已提交
587 588 589 590 591 592 593 594 595 596 597 598
	public boolean isAfterLast() throws InvalidResultSetAccessException {
		try {
			return this.resultSet.isAfterLast();
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}

	/**
	 * @see java.sql.ResultSet#isBeforeFirst()
	 */
599
	@Override
A
Arjen Poutsma 已提交
600 601 602 603 604 605 606 607
	public boolean isBeforeFirst() throws InvalidResultSetAccessException {
		try {
			return this.resultSet.isBeforeFirst();
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
608

A
Arjen Poutsma 已提交
609 610 611
	/**
	 * @see java.sql.ResultSet#isFirst()
	 */
612
	@Override
A
Arjen Poutsma 已提交
613 614 615 616 617 618 619 620
	public boolean isFirst() throws InvalidResultSetAccessException {
		try {
			return this.resultSet.isFirst();
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
621

A
Arjen Poutsma 已提交
622 623 624
	/**
	 * @see java.sql.ResultSet#isLast()
	 */
625
	@Override
A
Arjen Poutsma 已提交
626 627 628 629 630 631 632 633
	public boolean isLast() throws InvalidResultSetAccessException {
		try {
			return this.resultSet.isLast();
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
634

A
Arjen Poutsma 已提交
635 636 637
	/**
	 * @see java.sql.ResultSet#last()
	 */
638
	@Override
A
Arjen Poutsma 已提交
639 640 641 642 643 644 645 646
	public boolean last() throws InvalidResultSetAccessException {
		try {
			return this.resultSet.last();
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
647

A
Arjen Poutsma 已提交
648 649 650
	/**
	 * @see java.sql.ResultSet#next()
	 */
651
	@Override
A
Arjen Poutsma 已提交
652 653 654 655 656 657 658 659
	public boolean next() throws InvalidResultSetAccessException {
		try {
			return this.resultSet.next();
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
660

A
Arjen Poutsma 已提交
661 662 663
	/**
	 * @see java.sql.ResultSet#previous()
	 */
664
	@Override
A
Arjen Poutsma 已提交
665 666 667 668 669 670 671 672
	public boolean previous() throws InvalidResultSetAccessException {
		try {
			return this.resultSet.previous();
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
673

A
Arjen Poutsma 已提交
674 675 676
	/**
	 * @see java.sql.ResultSet#relative(int)
	 */
677
	@Override
A
Arjen Poutsma 已提交
678 679 680 681 682 683 684 685
	public boolean relative(int rows) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.relative(rows);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
686

A
Arjen Poutsma 已提交
687 688 689
	/**
	 * @see java.sql.ResultSet#wasNull()
	 */
690
	@Override
A
Arjen Poutsma 已提交
691 692 693 694 695 696 697 698 699 700
	public boolean wasNull() throws InvalidResultSetAccessException {
		try {
			return this.resultSet.wasNull();
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}

}