How to use a list of string in NamedParameterJDBCTemplate to get results

You can also use MapSqlParameterSource

String query = "SELECT FIRSTNAME FROM ACTORS WHERE LASTNAME in (:LASTNAME)";
Set<String> ids = ....;

MapSqlParameterSource parameters = new MapSqlParameterSource();
parameters.addValue("LASTNAME", ids);

this.namedparameterJdbcTemplate.query(query, parameters);

Use IN Clause..

How to use SELECT IN clause in JDBCTemplates?

List<String> lastnames= new ArrayList<>();

Map namedParameters = Collections.singletonMap("lastnamevalues", lastnames);

StringBuffer recordQueryString = new StringBuffer();

recordQueryString.append("select FIRSTNAME, LASTNAME from ACTORS where lastname in (:lastnamevalues)");

List nameInvolvements = this.namedparameterJdbcTemplate.query(recordQueryString.toString(), namedParameters, new MyMapper());