title: Java Spring JDBC template problem
body: <pre><code>public List&lt;Weather&gt; getWeather(int cityId, int days) {
      logger.info("days: " + days);
      return getSimpleJdbcTemplate().query("SELECT weather.id, cities.name, weather.date, weather.degree " +
                                          "FROM weather JOIN cities ON weather.city_id = cities.id " +
                                          "WHERE weather.city_id = ? AND weather.date BETWEEN now()::date AND (now() + '? days')::date",
                                          this.w_mapper, cityId, days);
  }
  </code></pre>
  
  <p>error : </p>
  
  <pre><code>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [SELECT weather.id, cities.name, weather.date, weather.degree FROM weather JOIN cities ON weather.city_id = cities.id WHERE weather.city_id = ? AND weather.date BETWEEN now()::date AND (now() + '? days')::date]; The column index is out of range: 2, number of columns: 1.; nested exception is org.postgresql.util.PSQLException: The column index is out of range: 2, number of columns: 1.
  </code></pre>
  
  <p>it works with :</p>
  
  <pre><code>public List&lt;Weather&gt; getWeather(int cityId, int days) {
      logger.info("days: " + days);
      return getSimpleJdbcTemplate().query("SELECT weather.id, cities.name, weather.date, weather.degree " +
                                          "FROM weather JOIN cities ON weather.city_id = cities.id " +
                                          "WHERE weather.city_id = ? AND weather.date = now()::date",
                                          this.w_mapper, cityId);
  }
  </code></pre>
  
  <p><strong>so the problem is when im using two ? marks in my query.
  how can i make it work to with 2 ? marks???</strong></p>