title: like clause in spring jdbc
body: <pre><code>@Override
  public List&lt;String&gt; getusers(String role) {
      // TODO Auto-generated method stub
      String namecount = "SELECT userName FROM users WHERE userName LIKE ?";
      role="\"%" + role + "%\"";
  
      List&lt;String&gt; 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;
  }
  </code></pre>
  
  <p>I am not understanding why I am get this error , please can one say where it went wrong </p>
  
  <pre><code>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
  </code></pre>