ResultSetWrappingSqlRowSet.java 18.4 KB
Newer Older
A
Arjen Poutsma 已提交
1
/*
2
 * Copyright 2002-2016 the original author or authors.
A
Arjen Poutsma 已提交
3 4 5 6 7
 *
 * 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
 *
S
Spring Operator 已提交
8
 *      https://www.apache.org/licenses/LICENSE-2.0
A
Arjen Poutsma 已提交
9 10 11 12 13 14 15 16 17 18 19 20 21
 *
 * 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
import java.util.Map;

import org.springframework.jdbc.InvalidResultSetAccessException;

/**
J
Juergen Hoeller 已提交
34 35 36
 * The default implementation of Spring's {@link SqlRowSet} interface, wrapping a
 * {@link java.sql.ResultSet}, catching any {@link SQLException}s and translating
 * them to a corresponding Spring {@link InvalidResultSetAccessException}.
A
Arjen Poutsma 已提交
37
 *
J
Juergen Hoeller 已提交
38
 * <p>The passed-in ResultSet should already be disconnected if the SqlRowSet is supposed
J
Juergen Hoeller 已提交
39
 * to be usable in a disconnected fashion. This means that you will usually pass in a
40
 * {@code javax.sql.rowset.CachedRowSet}, which implements the ResultSet interface.
A
Arjen Poutsma 已提交
41
 *
J
Juergen Hoeller 已提交
42 43 44 45
 * <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
46
 * exceptions such as the {@code com.sun.rowset.CachedRowSetImpl} class which only uses
J
Juergen Hoeller 已提交
47 48
 * 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
49
 * {@code com.sun.rowset.CachedRowSetImpl} which is the default implementation used by
J
Juergen Hoeller 已提交
50 51
 * {@link org.springframework.jdbc.core.JdbcTemplate} when working with RowSets.
 *
52
 * <p>Note: This class implements the {@code java.io.Serializable} marker interface
J
Juergen Hoeller 已提交
53 54 55
 * 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 已提交
56 57 58 59 60 61
 *
 * @author Thomas Risberg
 * @author Juergen Hoeller
 * @since 1.2
 * @see java.sql.ResultSet
 * @see javax.sql.rowset.CachedRowSet
J
Juergen Hoeller 已提交
62
 * @see org.springframework.jdbc.core.JdbcTemplate#queryForRowSet
A
Arjen Poutsma 已提交
63 64 65 66 67 68 69 70 71 72
 */
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;
73

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


	/**
	 * Create a new ResultSetWrappingSqlRowSet for the given ResultSet.
	 * @param resultSet a disconnected ResultSet to wrap
80
	 * (usually a {@code javax.sql.rowset.CachedRowSet})
A
Arjen Poutsma 已提交
81 82 83 84 85 86 87 88 89 90 91 92 93 94
	 * @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);
		}
95 96 97 98
		try {
			ResultSetMetaData rsmd = resultSet.getMetaData();
			if (rsmd != null) {
				int columnCount = rsmd.getColumnCount();
99
				this.columnLabelMap = new HashMap<>(columnCount);
100
				for (int i = 1; i <= columnCount; i++) {
101 102 103 104 105 106
					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);
					}
107 108 109
				}
			}
			else {
J
Juergen Hoeller 已提交
110
				this.columnLabelMap = Collections.emptyMap();
111
			}
J
Juergen Hoeller 已提交
112 113
		}
		catch (SQLException se) {
114 115
			throw new InvalidResultSetAccessException(se);
		}
116

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


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

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

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


	// RowSet methods for extracting data values

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

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

	/**
	 * @see java.sql.ResultSet#getBoolean(int)
	 */
183
	@Override
A
Arjen Poutsma 已提交
184 185 186 187 188 189 190 191 192 193 194 195
	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)
	 */
196
	@Override
197 198
	public boolean getBoolean(String columnLabel) throws InvalidResultSetAccessException {
		return getBoolean(findColumn(columnLabel));
A
Arjen Poutsma 已提交
199
	}
200

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

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

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

A
Arjen Poutsma 已提交
235
	/**
236
	 * @see java.sql.ResultSet#getDate(String)
A
Arjen Poutsma 已提交
237
	 */
238
	@Override
239 240 241 242 243 244 245 246 247
	public Date getDate(String columnLabel) throws InvalidResultSetAccessException {
		return getDate(findColumn(columnLabel));
	}

	/**
	 * @see java.sql.ResultSet#getDate(int, Calendar)
	 */
	@Override
	public Date getDate(int columnIndex, Calendar cal) throws InvalidResultSetAccessException {
A
Arjen Poutsma 已提交
248
		try {
249
			return this.resultSet.getDate(columnIndex, cal);
A
Arjen Poutsma 已提交
250 251 252 253 254
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
255

A
Arjen Poutsma 已提交
256
	/**
257
	 * @see java.sql.ResultSet#getDate(String, Calendar)
A
Arjen Poutsma 已提交
258
	 */
259
	@Override
260 261
	public Date getDate(String columnLabel, Calendar cal) throws InvalidResultSetAccessException {
		return getDate(findColumn(columnLabel), cal);
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

A
Arjen Poutsma 已提交
306 307 308
	/**
	 * @see java.sql.ResultSet#getInt(int)
	 */
309
	@Override
A
Arjen Poutsma 已提交
310 311 312 313 314 315 316 317 318 319 320 321
	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)
	 */
322
	@Override
323 324
	public int getInt(String columnLabel) throws InvalidResultSetAccessException {
		return getInt(findColumn(columnLabel));
A
Arjen Poutsma 已提交
325
	}
326

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

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

A
Arjen Poutsma 已提交
348
	/**
349
	 * @see java.sql.ResultSet#getNString(int)
A
Arjen Poutsma 已提交
350
	 */
351
	@Override
352
	public String getNString(int columnIndex) throws InvalidResultSetAccessException {
A
Arjen Poutsma 已提交
353
		try {
354
			return this.resultSet.getNString(columnIndex);
A
Arjen Poutsma 已提交
355 356 357 358 359
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
360

361 362 363 364 365 366 367 368
	/**
	 * @see java.sql.ResultSet#getNString(String)
	 */
	@Override
	public String getNString(String columnLabel) throws InvalidResultSetAccessException {
		return getNString(findColumn(columnLabel));
	}

A
Arjen Poutsma 已提交
369 370 371
	/**
	 * @see java.sql.ResultSet#getObject(int)
	 */
372
	@Override
A
Arjen Poutsma 已提交
373 374 375 376 377 378 379 380
	public Object getObject(int columnIndex) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getObject(columnIndex);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
381

A
Arjen Poutsma 已提交
382
	/**
383
	 * @see java.sql.ResultSet#getObject(String)
A
Arjen Poutsma 已提交
384
	 */
385
	@Override
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407
	public Object getObject(String columnLabel) throws InvalidResultSetAccessException {
		return getObject(findColumn(columnLabel));
	}

	/**
	 * @see java.sql.ResultSet#getObject(int, Map)
	 */
	@Override
	public Object getObject(int columnIndex, Map<String, Class<?>> map) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getObject(columnIndex, map);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}

	/**
	 * @see java.sql.ResultSet#getObject(String, Map)
	 */
	@Override
	public Object getObject(String columnLabel, Map<String, Class<?>> map) throws InvalidResultSetAccessException {
408
		return getObject(findColumn(columnLabel), map);
A
Arjen Poutsma 已提交
409
	}
410

A
Arjen Poutsma 已提交
411
	/**
412
	 * @see java.sql.ResultSet#getObject(int, Class)
A
Arjen Poutsma 已提交
413
	 */
414
	@Override
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429
	public <T> T getObject(int columnIndex, Class<T> type) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getObject(columnIndex, type);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}

	/**
	 * @see java.sql.ResultSet#getObject(String, Class)
	 */
	@Override
	public <T> T getObject(String columnLabel, Class<T> type) throws InvalidResultSetAccessException {
		return getObject(findColumn(columnLabel), type);
A
Arjen Poutsma 已提交
430
	}
431

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

A
Arjen Poutsma 已提交
445 446 447
	/**
	 * @see java.sql.ResultSet#getShort(String)
	 */
448
	@Override
449 450
	public short getShort(String columnLabel) throws InvalidResultSetAccessException {
		return getShort(findColumn(columnLabel));
A
Arjen Poutsma 已提交
451
	}
452

A
Arjen Poutsma 已提交
453 454 455
	/**
	 * @see java.sql.ResultSet#getString(int)
	 */
456
	@Override
A
Arjen Poutsma 已提交
457 458 459 460 461 462 463 464
	public String getString(int columnIndex) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getString(columnIndex);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
465

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

A
Arjen Poutsma 已提交
474 475 476
	/**
	 * @see java.sql.ResultSet#getTime(int)
	 */
477
	@Override
A
Arjen Poutsma 已提交
478 479 480 481 482 483 484 485 486 487 488 489
	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)
	 */
490
	@Override
491 492
	public Time getTime(String columnLabel) throws InvalidResultSetAccessException {
		return getTime(findColumn(columnLabel));
A
Arjen Poutsma 已提交
493
	}
494

A
Arjen Poutsma 已提交
495
	/**
496
	 * @see java.sql.ResultSet#getTime(int, Calendar)
A
Arjen Poutsma 已提交
497
	 */
498
	@Override
499
	public Time getTime(int columnIndex, Calendar cal) throws InvalidResultSetAccessException {
A
Arjen Poutsma 已提交
500
		try {
501
			return this.resultSet.getTime(columnIndex, cal);
A
Arjen Poutsma 已提交
502 503 504 505 506
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
507

508 509 510 511 512 513 514 515
	/**
	 * @see java.sql.ResultSet#getTime(String, Calendar)
	 */
	@Override
	public Time getTime(String columnLabel, Calendar cal) throws InvalidResultSetAccessException {
		return getTime(findColumn(columnLabel), cal);
	}

A
Arjen Poutsma 已提交
516 517 518
	/**
	 * @see java.sql.ResultSet#getTimestamp(int)
	 */
519
	@Override
A
Arjen Poutsma 已提交
520 521 522 523 524 525 526 527 528 529
	public Timestamp getTimestamp(int columnIndex) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getTimestamp(columnIndex);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}

	/**
530
	 * @see java.sql.ResultSet#getTimestamp(String)
A
Arjen Poutsma 已提交
531
	 */
532
	@Override
533 534
	public Timestamp getTimestamp(String columnLabel) throws InvalidResultSetAccessException {
		return getTimestamp(findColumn(columnLabel));
A
Arjen Poutsma 已提交
535 536 537
	}

	/**
538
	 * @see java.sql.ResultSet#getTimestamp(int, Calendar)
A
Arjen Poutsma 已提交
539
	 */
540
	@Override
541 542 543 544 545 546 547 548 549 550 551 552 553 554 555
	public Timestamp getTimestamp(int columnIndex, Calendar cal) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getTimestamp(columnIndex, cal);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}

	/**
	 * @see java.sql.ResultSet#getTimestamp(String, Calendar)
	 */
	@Override
	public Timestamp getTimestamp(String columnLabel, Calendar cal) throws InvalidResultSetAccessException {
		return getTimestamp(findColumn(columnLabel), cal);
A
Arjen Poutsma 已提交
556 557 558 559
	}


	// RowSet navigation methods
560

A
Arjen Poutsma 已提交
561 562 563
	/**
	 * @see java.sql.ResultSet#absolute(int)
	 */
564
	@Override
A
Arjen Poutsma 已提交
565 566 567 568 569 570 571 572 573 574 575 576
	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()
	 */
577
	@Override
A
Arjen Poutsma 已提交
578 579 580 581 582 583 584 585
	public void afterLast() throws InvalidResultSetAccessException {
		try {
			this.resultSet.afterLast();
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
586

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

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

	/**
	 * @see java.sql.ResultSet#getRow()
	 */
616
	@Override
A
Arjen Poutsma 已提交
617 618 619 620 621 622 623 624 625 626 627 628
	public int getRow() throws InvalidResultSetAccessException {
		try {
			return this.resultSet.getRow();
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}

	/**
	 * @see java.sql.ResultSet#isAfterLast()
	 */
629
	@Override
A
Arjen Poutsma 已提交
630 631 632 633 634 635 636 637 638 639 640 641
	public boolean isAfterLast() throws InvalidResultSetAccessException {
		try {
			return this.resultSet.isAfterLast();
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}

	/**
	 * @see java.sql.ResultSet#isBeforeFirst()
	 */
642
	@Override
A
Arjen Poutsma 已提交
643 644 645 646 647 648 649 650
	public boolean isBeforeFirst() throws InvalidResultSetAccessException {
		try {
			return this.resultSet.isBeforeFirst();
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
651

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

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

A
Arjen Poutsma 已提交
678 679 680
	/**
	 * @see java.sql.ResultSet#last()
	 */
681
	@Override
A
Arjen Poutsma 已提交
682 683 684 685 686 687 688 689
	public boolean last() throws InvalidResultSetAccessException {
		try {
			return this.resultSet.last();
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
690

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

A
Arjen Poutsma 已提交
704 705 706
	/**
	 * @see java.sql.ResultSet#previous()
	 */
707
	@Override
A
Arjen Poutsma 已提交
708 709 710 711 712 713 714 715
	public boolean previous() throws InvalidResultSetAccessException {
		try {
			return this.resultSet.previous();
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
716

A
Arjen Poutsma 已提交
717 718 719
	/**
	 * @see java.sql.ResultSet#relative(int)
	 */
720
	@Override
A
Arjen Poutsma 已提交
721 722 723 724 725 726 727 728
	public boolean relative(int rows) throws InvalidResultSetAccessException {
		try {
			return this.resultSet.relative(rows);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
729

A
Arjen Poutsma 已提交
730 731 732
	/**
	 * @see java.sql.ResultSet#wasNull()
	 */
733
	@Override
A
Arjen Poutsma 已提交
734 735 736 737 738 739 740 741 742 743
	public boolean wasNull() throws InvalidResultSetAccessException {
		try {
			return this.resultSet.wasNull();
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}

}