请问这种写法会发生sql注入问题吗

用的spring jdbc,这样算不算拼接sql语句,会产生sql注入问题吗

@Override
public List getUserListByUserIdAndName(Long userId, String userName) {
List userList = this.getJdbcTemplate().query(
"SELECT * FROM user WHERE is_display = true AND check_id = ? AND user_nam e = ?", this.getRowMapper(), userId, userName);
return userList;
}

你可以试试看,userName传入 xxx' or 1=1,看执行的sql是什么,如果 or 1=1没有包含在参数里,就说明注入了。