什么是spring.jdbc 4.2.5中getJdbcTemplate()的替换,我使用spring-4.2.5,spring-jdbc.4.2.5.mvn3

时间:2017-09-12 05:46:25

标签: java spring jdbc

@Override
    public Page<KeyClient> getKeyClients(KeyClient searchClient,
            List<Integer> selectedClients, boolean isExclude, int pageNo, int pageSize) throws DataAccessException {
        StringBuffer query = new StringBuffer(GET_CLIENT_LIST);
        StringBuffer query1 = new StringBuffer(GET_CLIENT_LIST_COUNT);


        /*StringBuffer query2 = new StringBuffer(GET_CLIENT_LIST1);
        StringBuffer query3 = new StringBuffer(GET_CLIENT_LIST_COUNT1);*/



        /*Map<String, Object> params = new HashMap<String, Object>();
        params = buildQueryForClients(searchClient, selectedClients, isExclude, query);*/


                Object[] params = buildQueryForClients(searchClient, selectedClients, isExclude, query, query1);

                PaginationHelper<KeyClient> ph = new PaginationHelper<KeyClient>();
                return ph.fetchPage(getJdbcTemplate(), query1.toString(),
                        query.toString(), params, pageNo, pageSize,
                new SingleColumnRowMapper<KeyClient>(){}.

返回语句中出现错误getJdbcTemplate()错误是 - 方法getJdbcTemplate()未定义类型MedNeXtCommonDAOImpl。

1 个答案:

答案 0 :(得分:0)

请参阅4.2.5 docs课程JdbcDaoSupport方法getJdbcTemplate()

  

public final JdbcTemplate getJdbcTemplate()返回   用于此DAO的JdbcTemplate,使用DataSource或set进行预初始化   明确。