private HashSet<Long> getOnStockGoodsSet(DBHelper helper) throws SQLException { HashSet<Long> onStockGoodsSet = new HashSet<>(); ResultSet rs = helper.executeQuery(queryOnstockProductSql); while (rs.next()) { long goodsId = rs.getLong("WARESKUCODE"); if (goodsId > 0) { onStockGoodsSet.add(goodsId); // System.out.println(goodsId); } } return onStockGoodsSet; }