Package org.springframework.jdbc.core

Examples of org.springframework.jdbc.core.RowMapperResultSetExtractor


                }
            }
        } else {
            Class<?> outputClzz = getCamelContext().getClassResolver().resolveClass(outputClass);
            RowMapper rowMapper = new BeanPropertyRowMapper(outputClzz);
            RowMapperResultSetExtractor<?> mapper = new RowMapperResultSetExtractor(rowMapper);
            List<?> data = mapper.extractData(rs);
            if (data.size() > 1) {
                throw new SQLDataException("Query result not unique for outputType=SelectOne. Got " + data.size() " count instead.");
            } else if (data.size() == 1) {
                result = data.get(0);
            }
View Full Code Here


                }
               
                boolean isResultSet = ps.execute();
               
                if (isResultSet) {
                    RowMapperResultSetExtractor mapper = new RowMapperResultSetExtractor(new ColumnMapRowMapper());
                    List<?> result = (List<?>) mapper.extractData(ps.getResultSet());
                    exchange.getOut().setBody(result);
                    // preserve headers
                    exchange.getOut().setHeaders(exchange.getIn().getHeaders());
                } else {
                    exchange.getIn().setHeader(UPDATE_COUNT, ps.getUpdateCount());
View Full Code Here

                }
               
                boolean isResultSet = ps.execute();
               
                if (isResultSet) {
                    RowMapperResultSetExtractor mapper = new RowMapperResultSetExtractor(new ColumnMapRowMapper());
                    List<?> result = (List<?>) mapper.extractData(ps.getResultSet());
                    exchange.getOut().setBody(result);
                    exchange.getIn().setHeader(SqlConstants.SQL_ROW_COUNT, result.size());
                    // preserve headers
                    exchange.getOut().setHeaders(exchange.getIn().getHeaders());
                } else {
View Full Code Here

                }
               
                boolean isResultSet = ps.execute();
               
                if (isResultSet) {
                    RowMapperResultSetExtractor mapper = new RowMapperResultSetExtractor(new ColumnMapRowMapper());
                    List<?> result = (List<?>) mapper.extractData(ps.getResultSet());
                    exchange.getOut().setBody(result);
                    exchange.getIn().setHeader(SqlConstants.SQL_ROW_COUNT, result.size());
                    // preserve headers
                    exchange.getOut().setHeaders(exchange.getIn().getHeaders());
                } else {
View Full Code Here

                }
               
                boolean isResultSet = ps.execute();
               
                if (isResultSet) {
                    RowMapperResultSetExtractor mapper = new RowMapperResultSetExtractor(new ColumnMapRowMapper());
                    List<?> result = (List<?>) mapper.extractData(ps.getResultSet());
                    exchange.getOut().setBody(result);
                    exchange.getIn().setHeader(SqlConstants.SQL_ROW_COUNT, result.size());
                    // preserve headers
                    exchange.getOut().setHeaders(exchange.getIn().getHeaders());
                } else {
View Full Code Here

                }
               
                boolean isResultSet = ps.execute();
               
                if (isResultSet) {
                    RowMapperResultSetExtractor mapper = new RowMapperResultSetExtractor(new ColumnMapRowMapper());
                    List<?> result = (List<?>) mapper.extractData(ps.getResultSet());
                    exchange.getOut().setBody(result);
                    exchange.getIn().setHeader(SqlConstants.SQL_ROW_COUNT, result.size());
                    // preserve headers
                    exchange.getOut().setHeaders(exchange.getIn().getHeaders());
                } else {
View Full Code Here

                }
            }
        } else {
            Class<?> outputClzz = getCamelContext().getClassResolver().resolveClass(outputClass);
            RowMapper rowMapper = new BeanPropertyRowMapper(outputClzz);
            RowMapperResultSetExtractor<?> mapper = new RowMapperResultSetExtractor(rowMapper);
            List<?> data = mapper.extractData(rs);
            if (data.size() > 1) {
                throw new SQLDataException("Query result not unique for outputType=SelectOne. Got " + data.size() " count instead.");
            } else if (data.size() == 1) {
                result = data.get(0);
            }
View Full Code Here

                }
               
                boolean isResultSet = ps.execute();
               
                if (isResultSet) {
                    RowMapperResultSetExtractor mapper = new RowMapperResultSetExtractor(new ColumnMapRowMapper());
                    List<?> result = (List<?>) mapper.extractData(ps.getResultSet());
                    exchange.getOut().setBody(result);
                    exchange.getIn().setHeader(SqlConstants.SQL_ROW_COUNT, result.size());
                    // preserve headers
                    exchange.getOut().setHeaders(exchange.getIn().getHeaders());
                } else {
View Full Code Here

                for (Iterator<?> i = exchange.getIn().getBody(Iterator.class); i.hasNext();) {
                    ps.setObject(argNumber++, i.next());
                }
                boolean isResultSet = ps.execute();
                if (isResultSet) {
                    RowMapperResultSetExtractor mapper = new RowMapperResultSetExtractor(
                                                                                         new ColumnMapRowMapper());
                    List<?> result = (List<?>)mapper.extractData(ps.getResultSet());
                    exchange.getOut().setBody(result);
                } else {
                    exchange.getIn().setHeader(UPDATE_COUNT, ps.getUpdateCount());
                }
                return null;
View Full Code Here

    }

    @Override
    public List<?> select(String sql, Object[] args, RowMapper rowMapper) {
        PreparedStatementCreator csc = getPreparedStatementCreator(sql, args, false);
        return (List<?>) jdbcTemplate.query(csc, new RowMapperResultSetExtractor(rowMapper));
    }
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.core.RowMapperResultSetExtractor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.