Code example for ResultSet

Methods: getDate, getInt

0
@SuppressWarnings("rawtypes") 
public final class ClientRequestResultSetExtractor implements ResultSetExtractor { 
	@Override 
	public Object extractData(ResultSet rs) throws SQLException, DataAccessException {
		ClientRequest req = new ClientRequest();
		req.setInitDate(rs.getDate("Date_Request"));
		req.setKey(rs.getInt("Key_Request"));
		req.setNumber(rs.getInt("Number_Request"));
		int performed = rs.getInt("Performed_Request");
		if (performed != 0) {
			req.setPerformed(true);
		} else { 
			req.setPerformed(false);	
		} 
		 
		Client reqClient = new Client();
		reqClient.setKey(rs.getInt("Key_Client"));
		req.setClient(reqClient);
		return req;
	} 
}