Jdbctemplate query for string: EmptyResultDataAccessException: Incorrect result size: expected 1, actual 0

前端 未结 17 1244
执笔经年
执笔经年 2020-11-29 16:22

I am using Jdbctemplate to retrieve a single String value from the db. Here is my method.

    public String test() {
        String cert=null;
        Strin         


        
17条回答
  •  佛祖请我去吃肉
    2020-11-29 17:01

    to make

        jdbcTemplate.queryForList(sql, String.class)
    

    work, make sure your jdbcTemplate is of type

        org.springframework.jdbc.core.JdbcTemplate
    

提交回复
热议问题