I have a list of strings which is returned from a query in List A.
I am trying to use String Utils.join to combine the values in the list to a string separated by comma and in quotes. But it is not working as expected.
Values in abcList - [abc, cde, fgh]
abcList.addAll(jdbcTemplate.queryForList(abcSql, String.class));
String abc= StringUtils.join(abcList, "','");
abc = "'" +abc+ "'";
Expected output - 'abc', 'cde', 'fgh'
Actual output - 'abc, cde, fgh'
I am not sure what I am doing wrong here as I want to pass the values form the string abc into query with "IN" condition.