All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.onetwo.dbm.jdbc.SimpleMapRowMapperResultSetExtractor Maven / Gradle / Ivy

The newest version!
package org.onetwo.dbm.jdbc;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

import org.onetwo.common.utils.Tuple;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;

public interface SimpleMapRowMapperResultSetExtractor extends ResultSetExtractor> {

	@Override
	default public Map extractData(ResultSet rs) throws SQLException, DataAccessException {
		Map results = new HashMap<>();
		while (rs.next()) {
			Tuple rowTuple = createRow(rs);
			results.put(rowTuple.getKey(), rowTuple.getValue());
		}
		return results;
	}
	
	Tuple createRow(ResultSet res) throws SQLException, DataAccessException;

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy