@Override
    public <T> List<T> sendQuery(String query, Object[] params, int pageSize, Connection conn, RowMapper<T> mapper) throws DaoException {
        if (params == null) {
            throw new DaoException(PARAMS_IS_NULL_ERROR);
        }

        List<T> result = new ArrayList<>();
        PreparedStatement ps = null;
        ResultSet rs = null;
        try {
            ps = conn.prepareStatement(query);
            ps.setFetchSize(pageSize);
            for (int i = 0; i < params.length; i++) {
                ps.setObject(i + 1, params[i]);
            }
            rs = ps.executeQuery();
            int i = 0;
            while(rs.next()) {
                result.add(mapper.mapRow(rs, i++));
            }
        } catch (SQLException ex) {
            throw new DaoSqlException(ex.getMessage(), ex);
        } finally {
            try {
                if (rs != null && !rs.isClosed()) {
                    rs.close();
                }
                if (ps != null && !ps.isClosed()){
                    ps.close();
                }
            } catch (SQLException ex) {
                LOGGER.info(CLOSE_ERROR);
            }
        }
        return result;
    }