title: passing different types of arguments to jdbctemplate query
body: <p>I am trying to retrieve records from the database by using where clause with few different types of arguments. This is the simple method which I wrote where I am passing breedId and gender as an arguments. </p>
  
  <pre><code>public List&lt;Dog&gt; listByBreedIdAndGender(long breedId, String gender) {  
    return query("SELECT * FROM dog_entity WHERE breed__id = ? AND gender = ?",
            new MapSqlParameterSource(":breedId", breedId)
            .addValue(":gender", gender));
   }
  
  private List&lt;Dog&gt; query(String sql, MapSqlParameterSource parameters) {  
    List&lt;Dog&gt; dogs = jdbcTemplate.query(sql, new DogRowMapper(), parameters);
    return dogs;
   }
  </code></pre>
  
  <p>I ran this method but got below exception. Can anyone let me know how to pass multiple arguments to the jdbcTemplate.query(), I am kinda new to it.</p>
  
  <pre><code>{
  timestamp: 1419637479460
  status: 500
  error: "Internal Server Error"
  exception: "org.springframework.dao.TransientDataAccessResourceException"
  message: "PreparedStatementCallback; SQL [SELECT * FROM dog_entity WHERE breed__id = ? AND gender = ?]; Invalid argument value: java.io.NotSerializableException; nested exception is java.sql.SQLException: Invalid argument value: java.io.NotSerializableException"
  path: "/api/2/m"
  }
  </code></pre>