private List<String> getExcludes(String eventId){
String sql = "select LISTAGG(messageSubject, ',') WITHIN GROUP (ORDER BY messageSubject) AS excludes from exclude where eventid = ?";
String excludes = (String) jdbcTemplate.queryForObject(sql, new Object[] {eventId}, String.class);
if(StringUtils.isNotEmpty(excludes)){
return Arrays.asList(excludes.split(","));
}
return null;
}
当通过jdbctemplate.queryForObject在sql上运行时,我得到了null结果,但是当我在数据库中运行相同的查询时,我将逗号分隔的结果作为 - TEMP-SUBJECT-36 ,TEMP-SUBJECT-37,TEMP-SUBJECT-38,为什么jdbc模板查询返回null,我在这里做错了,请帮帮忙?