public void checkStockLevels() {
     //   System.out.println("checkstocklevels *****************");
        try {
            PreparedStatement stmt = connection.prepareStatement("select unique mname from DepotItem");

            ResultSet rs = stmt.executeQuery();

            //int number;
            while (rs.next()) {
                PreparedStatement sstmt = connection.prepareStatement("select count(stock_number) as numcount " +
                        "from DepotItem " +
                        "where quantity < min_stock and trim(mname) = trim(?)");
                sstmt.setString(1, rs.getString("mname"));
                ResultSet srs = sstmt.executeQuery();
                if (srs.next()) {
                    //System.out.println();
                //    System.out.println("mname: " + rs.getString("mname") + "; number: " + srs.getInt("numcount") + "; stock_number: ");
                    
                    if (srs.getInt("numcount") >= 3) 
                    {
                        
                        sendReplenishmentOrder(rs.getString("mname"));
                    }
                }
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
      //  System.out.println("checkStockLevels END*******************");
    }