org.itsallcode.jdbc.resultset.RowMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of simple-jdbc Show documentation
Show all versions of simple-jdbc Show documentation
Library to simplify using JDBC
package org.itsallcode.jdbc.resultset;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
* Converts a single row from a {@link ResultSet} to a generic row type.
*
* @param generic row type
*/
@FunctionalInterface
public interface RowMapper {
/**
* Converts a single row from a {@link ResultSet} to a generic row type.
*
* @param resultSet result set
* @param rowNum the current row number (zero based)
* @return the converted row
* @throws SQLException if accessing the result set fails
*/
T mapRow(ResultSet resultSet, int rowNum) throws SQLException;
}