Spring Batch java.sql.SQLException.RowMapper获取页数和记录号

时间:2018-05-22 12:53:44

标签: java spring spring-batch spring-jdbc rowmapper

如何获取java.sql.SQLException.RowMapper接口中的页数?

import java.sql.ResultSet;
import java.sql.SQLException;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.jdbc.core.RowMapper;

    public class MyRowMapper implements RowMapper<MyDto> {

        private static final Logger log = LogManager.getLogger(MyRowMapper.class);

        public MyDto mapRow(ResultSet rs, int rowNum) throws SQLException {

            log.info(" Page: " + page + " Record " + rowNum);


           }
}

1 个答案:

答案 0 :(得分:0)

您没有关于RowMapper接口上的页数的信息。它只是一个将结果集映射到Java对象的接口。