Statement StringBuilder or StringBuffer
StringBuilder sb = new StringBuilder();
Append method further connected within the loop
for(int i=0;i<b.length;i++){
String sqlId = '''select building_project_name
from face_camera_info
where building_project_id = ?'''
String d = jdbcTemplate.queryForObject(sqlId,String.class,Integer.parseInt(b[i]))
sb.append(d+',')
}
DeleteCharAt method can be used to delete the last comma outside the loop
sb.deleteCharAt(sb.length()-1)
ps: What is the problem exhibitions