Merge branch '6.0.x'

This commit is contained in:
Sam Brannen 2023-06-22 15:28:34 +02:00
commit 40596433f1
1 changed files with 15 additions and 11 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2023 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -20,15 +20,17 @@ import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
/** /**
* An interface used by {@link JdbcTemplate} for processing rows of a * An interface used by {@link JdbcTemplate} and
* {@link org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
* NamedParameterJdbcTemplate} for processing rows of a
* {@link java.sql.ResultSet} on a per-row basis. Implementations of * {@link java.sql.ResultSet} on a per-row basis. Implementations of
* this interface perform the actual work of processing each row * this interface perform the actual work of processing each row
* but don't need to worry about exception handling. * but don't need to worry about exception handling.
* {@link java.sql.SQLException SQLExceptions} will be caught and handled * {@link java.sql.SQLException SQLExceptions} will be caught and handled
* by the calling JdbcTemplate. * by the calling {@code JdbcTemplate} or {@code NamedParameterJdbcTemplate}.
* *
* <p>In contrast to a {@link ResultSetExtractor}, a RowCallbackHandler * <p>In contrast to a {@link ResultSetExtractor}, a {@code RowCallbackHandler}
* object is typically stateful: It keeps the result state within the * object is typically stateful: it keeps the result state within the
* object, to be available for later inspection. See * object, to be available for later inspection. See
* {@link RowCountCallbackHandler} for a usage example. * {@link RowCountCallbackHandler} for a usage example.
* *
@ -38,6 +40,7 @@ import java.sql.SQLException;
* @author Rod Johnson * @author Rod Johnson
* @author Juergen Hoeller * @author Juergen Hoeller
* @see JdbcTemplate * @see JdbcTemplate
* @see org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate NamedParameterJdbcTemplate
* @see RowMapper * @see RowMapper
* @see ResultSetExtractor * @see ResultSetExtractor
* @see RowCountCallbackHandler * @see RowCountCallbackHandler
@ -47,14 +50,15 @@ public interface RowCallbackHandler {
/** /**
* Implementations must implement this method to process each row of data * Implementations must implement this method to process each row of data
* in the ResultSet. This method should not call {@code next()} on * in the {@link ResultSet}. This method should not call {@code next()} on
* the ResultSet; it is only supposed to extract values of the current row. * the {@code ResultSet}; it is only supposed to extract values of the current
* row.
* <p>Exactly what the implementation chooses to do is up to it: * <p>Exactly what the implementation chooses to do is up to it:
* A trivial implementation might simply count rows, while another * a trivial implementation might simply count rows, while another
* implementation might build an XML document. * implementation might build an XML document.
* @param rs the ResultSet to process (pre-initialized for the current row) * @param rs the {@code ResultSet} to process (pre-initialized for the current row)
* @throws SQLException if an SQLException is encountered getting * @throws SQLException if an {@code SQLException} is encountered getting
* column values (that is, there's no need to catch SQLException) * column values (that is, there's no need to catch {@code SQLException})
*/ */
void processRow(ResultSet rs) throws SQLException; void processRow(ResultSet rs) throws SQLException;