by Bruce on October 25, 2010
Apple has deprecated their port of Java. Spencer’s thoughts on the topic are insightful. I don’t recall Apple changing their mind very often so hopefully someone steps in to fill the void before it becomes a problem for us Java developers. Fortunately we have some time.
by Bruce on August 2, 2010
http://blog.springsource.com/2009/11/17/spring-3-type-conversion-and-validation/
by Bruce on August 2, 2010
by Bruce on June 14, 2010
If you have a List and want to pass it to a JDBC query as a parameter, try this. In this example we have a list of widget names and we want in return a list of store Id’s. For the sake of this example we are not looking to associate which stores sell which widgets. We simply want to know of any store that sells any of the widgets.
public List<Map<String,Object>> getStoresByWidgets(List<String> widgetNameList) {
NamedParameterJdbcTemplate namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(jdbcTemplate);
Map<String, Object> parameterMap = new HashMap<String, Object>();
parameterMap.put("widgetNames", widgetNameList);
String sql =
"SELECT store_id \n" +
" FROM widget_store_vw wsv \n" +
" WHERE store_status = 'Active' \n" +
" AND widget_name in (:widgetNames) ";
return namedParameterJdbcTemplate.queryForList(sql, parameterMap);
}