31
31
import org .springframework .jdbc .InvalidResultSetAccessException ;
32
32
33
33
/**
34
- * Default implementation of Spring's {@link SqlRowSet} interface.
34
+ * The default implementation of Spring's {@link SqlRowSet} interface, wrapping a
35
+ * {@link java.sql.ResultSet}, catching any {@link SQLException}s and translating
36
+ * them to a corresponding Spring {@link InvalidResultSetAccessException}.
35
37
*
36
- * <p>This implementation wraps a {@code javax.sql.ResultSet}, catching any SQLExceptions
37
- * and translating them to the appropriate Spring {@link InvalidResultSetAccessException}.
38
- *
39
- * <p>The passed-in ResultSets should already be disconnected if the SqlRowSet is supposed
38
+ * <p>The passed-in ResultSet should already be disconnected if the SqlRowSet is supposed
40
39
* to be usable in a disconnected fashion. This means that you will usually pass in a
41
40
* {@code javax.sql.rowset.CachedRowSet}, which implements the ResultSet interface.
42
41
*
@@ -221,46 +220,47 @@ public byte getByte(String columnLabel) throws InvalidResultSetAccessException {
221
220
}
222
221
223
222
/**
224
- * @see java.sql.ResultSet#getDate(int, java.util.Calendar )
223
+ * @see java.sql.ResultSet#getDate(int)
225
224
*/
226
225
@ Override
227
- public Date getDate (int columnIndex , Calendar cal ) throws InvalidResultSetAccessException {
226
+ public Date getDate (int columnIndex ) throws InvalidResultSetAccessException {
228
227
try {
229
- return this .resultSet .getDate (columnIndex , cal );
228
+ return this .resultSet .getDate (columnIndex );
230
229
}
231
230
catch (SQLException se ) {
232
231
throw new InvalidResultSetAccessException (se );
233
232
}
234
233
}
235
234
236
235
/**
237
- * @see java.sql.ResultSet#getDate(int )
236
+ * @see java.sql.ResultSet#getDate(String )
238
237
*/
239
238
@ Override
240
- public Date getDate (int columnIndex ) throws InvalidResultSetAccessException {
239
+ public Date getDate (String columnLabel ) throws InvalidResultSetAccessException {
240
+ return getDate (findColumn (columnLabel ));
241
+ }
242
+
243
+ /**
244
+ * @see java.sql.ResultSet#getDate(int, Calendar)
245
+ */
246
+ @ Override
247
+ public Date getDate (int columnIndex , Calendar cal ) throws InvalidResultSetAccessException {
241
248
try {
242
- return this .resultSet .getDate (columnIndex );
249
+ return this .resultSet .getDate (columnIndex , cal );
243
250
}
244
251
catch (SQLException se ) {
245
252
throw new InvalidResultSetAccessException (se );
246
253
}
247
254
}
255
+
248
256
/**
249
- * @see java.sql.ResultSet#getDate(String, java.util. Calendar)
257
+ * @see java.sql.ResultSet#getDate(String, Calendar)
250
258
*/
251
259
@ Override
252
260
public Date getDate (String columnLabel , Calendar cal ) throws InvalidResultSetAccessException {
253
261
return getDate (findColumn (columnLabel ), cal );
254
262
}
255
263
256
- /**
257
- * @see java.sql.ResultSet#getDate(String)
258
- */
259
- @ Override
260
- public Date getDate (String columnLabel ) throws InvalidResultSetAccessException {
261
- return getDate (findColumn (columnLabel ));
262
- }
263
-
264
264
/**
265
265
* @see java.sql.ResultSet#getDouble(int)
266
266
*/
@@ -302,6 +302,7 @@ public float getFloat(int columnIndex) throws InvalidResultSetAccessException {
302
302
public float getFloat (String columnLabel ) throws InvalidResultSetAccessException {
303
303
return getFloat (findColumn (columnLabel ));
304
304
}
305
+
305
306
/**
306
307
* @see java.sql.ResultSet#getInt(int)
307
308
*/
@@ -345,47 +346,47 @@ public long getLong(String columnLabel) throws InvalidResultSetAccessException {
345
346
}
346
347
347
348
/**
348
- * @see java.sql.ResultSet#getObject(int, java.util.Map )
349
+ * @see java.sql.ResultSet#getObject(int)
349
350
*/
350
351
@ Override
351
- public Object getObject (int i , Map < String , Class <?>> map ) throws InvalidResultSetAccessException {
352
+ public Object getObject (int columnIndex ) throws InvalidResultSetAccessException {
352
353
try {
353
- return this .resultSet .getObject (i , map );
354
+ return this .resultSet .getObject (columnIndex );
354
355
}
355
356
catch (SQLException se ) {
356
357
throw new InvalidResultSetAccessException (se );
357
358
}
358
359
}
359
360
360
361
/**
361
- * @see java.sql.ResultSet#getObject(int )
362
+ * @see java.sql.ResultSet#getObject(String )
362
363
*/
363
364
@ Override
364
- public Object getObject (int columnIndex ) throws InvalidResultSetAccessException {
365
+ public Object getObject (String columnLabel ) throws InvalidResultSetAccessException {
366
+ return getObject (findColumn (columnLabel ));
367
+ }
368
+
369
+ /**
370
+ * @see java.sql.ResultSet#getObject(int, Map)
371
+ */
372
+ @ Override
373
+ public Object getObject (int columnIndex , Map <String , Class <?>> map ) throws InvalidResultSetAccessException {
365
374
try {
366
- return this .resultSet .getObject (columnIndex );
375
+ return this .resultSet .getObject (columnIndex , map );
367
376
}
368
377
catch (SQLException se ) {
369
378
throw new InvalidResultSetAccessException (se );
370
379
}
371
380
}
372
381
373
382
/**
374
- * @see java.sql.ResultSet#getObject(String, java.util. Map)
383
+ * @see java.sql.ResultSet#getObject(String, Map)
375
384
*/
376
385
@ Override
377
- public Object getObject (String columnLabel , Map <String , Class <?>> map ) throws InvalidResultSetAccessException {
386
+ public Object getObject (String columnLabel , Map <String , Class <?>> map ) throws InvalidResultSetAccessException {
378
387
return getObject (findColumn (columnLabel ), map );
379
388
}
380
389
381
- /**
382
- * @see java.sql.ResultSet#getObject(String)
383
- */
384
- @ Override
385
- public Object getObject (String columnLabel ) throws InvalidResultSetAccessException {
386
- return getObject (findColumn (columnLabel ));
387
- }
388
-
389
390
/**
390
391
* @see java.sql.ResultSet#getShort(int)
391
392
*/
@@ -428,19 +429,6 @@ public String getString(String columnLabel) throws InvalidResultSetAccessExcepti
428
429
return getString (findColumn (columnLabel ));
429
430
}
430
431
431
- /**
432
- * @see java.sql.ResultSet#getTime(int, java.util.Calendar)
433
- */
434
- @ Override
435
- public Time getTime (int columnIndex , Calendar cal ) throws InvalidResultSetAccessException {
436
- try {
437
- return this .resultSet .getTime (columnIndex , cal );
438
- }
439
- catch (SQLException se ) {
440
- throw new InvalidResultSetAccessException (se );
441
- }
442
- }
443
-
444
432
/**
445
433
* @see java.sql.ResultSet#getTime(int)
446
434
*/
@@ -454,14 +442,6 @@ public Time getTime(int columnIndex) throws InvalidResultSetAccessException {
454
442
}
455
443
}
456
444
457
- /**
458
- * @see java.sql.ResultSet#getTime(String, java.util.Calendar)
459
- */
460
- @ Override
461
- public Time getTime (String columnLabel , Calendar cal ) throws InvalidResultSetAccessException {
462
- return getTime (findColumn (columnLabel ), cal );
463
- }
464
-
465
445
/**
466
446
* @see java.sql.ResultSet#getTime(String)
467
447
*/
@@ -471,18 +451,26 @@ public Time getTime(String columnLabel) throws InvalidResultSetAccessException {
471
451
}
472
452
473
453
/**
474
- * @see java.sql.ResultSet#getTimestamp (int, java.util. Calendar)
454
+ * @see java.sql.ResultSet#getTime (int, Calendar)
475
455
*/
476
456
@ Override
477
- public Timestamp getTimestamp (int columnIndex , Calendar cal ) throws InvalidResultSetAccessException {
457
+ public Time getTime (int columnIndex , Calendar cal ) throws InvalidResultSetAccessException {
478
458
try {
479
- return this .resultSet .getTimestamp (columnIndex , cal );
459
+ return this .resultSet .getTime (columnIndex , cal );
480
460
}
481
461
catch (SQLException se ) {
482
462
throw new InvalidResultSetAccessException (se );
483
463
}
484
464
}
485
465
466
+ /**
467
+ * @see java.sql.ResultSet#getTime(String, Calendar)
468
+ */
469
+ @ Override
470
+ public Time getTime (String columnLabel , Calendar cal ) throws InvalidResultSetAccessException {
471
+ return getTime (findColumn (columnLabel ), cal );
472
+ }
473
+
486
474
/**
487
475
* @see java.sql.ResultSet#getTimestamp(int)
488
476
*/
@@ -497,19 +485,32 @@ public Timestamp getTimestamp(int columnIndex) throws InvalidResultSetAccessExce
497
485
}
498
486
499
487
/**
500
- * @see java.sql.ResultSet#getTimestamp(String, java.util.Calendar )
488
+ * @see java.sql.ResultSet#getTimestamp(String)
501
489
*/
502
490
@ Override
503
- public Timestamp getTimestamp (String columnLabel , Calendar cal ) throws InvalidResultSetAccessException {
504
- return getTimestamp (findColumn (columnLabel ), cal );
491
+ public Timestamp getTimestamp (String columnLabel ) throws InvalidResultSetAccessException {
492
+ return getTimestamp (findColumn (columnLabel ));
505
493
}
506
494
507
495
/**
508
- * @see java.sql.ResultSet#getTimestamp(String )
496
+ * @see java.sql.ResultSet#getTimestamp(int, Calendar )
509
497
*/
510
498
@ Override
511
- public Timestamp getTimestamp (String columnLabel ) throws InvalidResultSetAccessException {
512
- return getTimestamp (findColumn (columnLabel ));
499
+ public Timestamp getTimestamp (int columnIndex , Calendar cal ) throws InvalidResultSetAccessException {
500
+ try {
501
+ return this .resultSet .getTimestamp (columnIndex , cal );
502
+ }
503
+ catch (SQLException se ) {
504
+ throw new InvalidResultSetAccessException (se );
505
+ }
506
+ }
507
+
508
+ /**
509
+ * @see java.sql.ResultSet#getTimestamp(String, Calendar)
510
+ */
511
+ @ Override
512
+ public Timestamp getTimestamp (String columnLabel , Calendar cal ) throws InvalidResultSetAccessException {
513
+ return getTimestamp (findColumn (columnLabel ), cal );
513
514
}
514
515
515
516
0 commit comments