Code example for NamedParameterJdbcDaoSupport

Methods: getNamedParameterJdbcTemplate

2
 
			MapSqlParameterSource parameters = new MapSqlParameterSource(); 
			parameters.addValue("authors", author_records); 
			parameters.addValue("cluster", target_aid); 
			//return null; 
			return getNamedParameterJdbcTemplate().update(sql, parameters); 
		} 
	} 
 
	private static final String DEF_UPDATE_NDOCS_QUERY =  
		"UPDATE cannames SET ndocs=(SELECT count(distinct p.cluster) FROM authors AS a JOIN papers as p " + 
		"ON p.id=a.paperid WHERE a.cluster=?) where id=?"; 
	private class UpdateAuthorNdocs extends SqlUpdate { 
		public UpdateAuthorNdocs(DataSource dataSource) { 
			setDataSource(dataSource); 
			setSql(DEF_UPDATE_NDOCS_QUERY); 
            declareParameter(new SqlParameter(Types.INTEGER)); // ID 
			declareParameter(new SqlParameter(Types.INTEGER)); // ID 
			compile(); 
		} 
Contextual code suggestions in your IDE  Get Codota for Java