I think the easiest way is to pass a list is to use
org.springframework.jdbc.core.namedparam.MapSqlParameterSource.MapSqlParameterSource()
which can take any type of argument for a prepared statement.
So, in your case, you can modify your SQL
like this to take list parameter:
String sql = "select * from table where enterprise_id in (:listOfInt)";.
Then add the list as parameter:
MapSqlParameterSource sqlParams = new MapSqlParameterSource();
sqlParams.addValue("listOfInt", Arrays.asList(1,2,3));
Pass it to the org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
instance to execute the query like this,
this.namedParameterJdbcTemplate.queryForList(sql, sqlParams);
Which gives you a resultset, further this assumes that you have created an instance of NamedParameterJdbcTemplate
at the class level.