code: public int insert(String sql,Object[] params,String autoGeneratedColumnName)
  			throws DataAccessException{
  		//dynamic change catalog name
  		sql = changeCatalog(sql);
  		
  		ReturnIdPreparedStatementCreator psc = new ReturnIdPreparedStatementCreator(sql, params, autoGeneratedColumnName);
  		KeyHolder keyHolder = new GeneratedKeyHolder();
  		try{
  			jdbcTemplate.update(psc, keyHolder);
  		}catch(DataAccessException e){
  			StringBuilder sb = new StringBuilder();
  			sb.append("[");
  			for(Object p:params){
  				sb.append(p + " | ");
  			}
  			sb.append("]");
  			logger.error("Error SQL: " + sql + " Params: " + sb.toString());
  			throw e;
  		}
  		
  		return keyHolder.getKey().intValue();
  	}
docs: insert a row with auto increament id
  @param sql
  @param params
  @param autoGeneratedColumnName
  @return
  @throws DataAccessException