Code example for ResultSet

Methods: getDate, getInt, getString

0
@SuppressWarnings("rawtypes") 
public class CheckingResultSetExtractor implements ResultSetExtractor { 
	@Override 
	public Object extractData(ResultSet rs) throws SQLException, DataAccessException {
		Checking checking = new Checking();
		checking.setKey(rs.getInt("Key_Checking"));
		checking.setNumberOfCertificate(rs.getString("Number_Certificate_Checking"));
		checking.setComment(rs.getString("Comment_Checking"));
		checking.setDateStartChecking(rs.getDate("Date_Start_Checking"));
		checking.setDateEndChecking(rs.getDate("Date_End_Checking"));
		checking.setNextDateChecking(rs.getDate("Date_Next_Checking"));
		 
		Tool tool = new Tool();
		tool.setKey(rs.getInt("Key_MR"));
		checking.setTool(tool);
		return checking;
	} 
 
}