code: protected ArrayList<Long> getSequencePortion(String seqName, int number) {
  		if (number < 1 || number > 100000)
  			throw new IllegalArgumentException("Invalid requested sequence count: " + number);
  		String sql = "select nextval('" + seqName + "') as seqval from generate_series(1," + number + ")";
  		List<ResSeqVal> seqVals = selectData("seq_portion", sql, ResSeqVal.class, Collections.<SqlParam>emptyList());
  		ArrayList<Long> result = new ArrayList<Long>();
  		for (ResSeqVal item : seqVals) {
  			result.add(item.seqval);
  		}
  		return result;
  	}
docs: /* postgres only