-2
@Override
public List<String> getusers(String role) {
    // TODO Auto-generated method stub
    String namecount = "SELECT userName FROM users WHERE userName LIKE ?";
    role="\"%" + role + "%\"";

    List<String> names = jdbcTemplate.query("SELECT userName FROM users where userName like ?", new RowMapper() {
          public Object mapRow(ResultSet resultSet, int i) throws SQLException {
            return resultSet.getString(1);
          }
        },role);
    System.out.println(names);
    return names;
}

このエラーが発生する理由がわかりません。どこで問題が発生したか教えてください

Error message:
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [SELECT userName FROM users userName like ?]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like '%blabla%'' at line 1
4

1 に答える 1