spring jdbc template rowmapper example

    public ArrayList getSearchResultByColumn_isAdmin(ABCResultForm  form, String roleId) {
        String query = StringConstants.ABC_RESULT_SEARCH_BY_COLUMN;
        System.out.println("Comes here getSearchResultByColumn");
        int count = 0;
                       query = query + " ORDER BY PROCESSING_DATE_START desc ";
                return (ArrayList) getJdbcTemplate().query(query,new Object[] {},new RowMapper() {
                            public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
                                String status;
                                if (rs.getString(4).equals("11"))
                                    status = "Error";
                                    status = "Ok/Warning";
                                ABCResultDataBean abcResultBean = new ABCResultDataBean(rs.getString(1), rs.getString(2), rs.getString(3), status,
                                        rs.getString(5), rs.getString(6), rs.getString(7), rs.getString(8));
                                return abcResultBean  ;


Popular posts from this blog

Spring MVC- Redirect from one controller to another

Integrating Struts2 with Spring Security using Custom Login Form