public int findOrder(int orderId) {
        int row = -1;

        for (int i = 0; i < getRowCount(); i++) {
            if (((Integer) data[i][1]).intValue() == orderId) {
                row = i;
                break;
            }
        }

        if (row < 0) {
            try {
                StoreDB db = new StoreDB();
                //System.out.print("select orders.date_purchased, orders.orders_id, orders.orders_total, orders.orders_tax, orders.payment_method, users.users_username, orders.orders_status from orders, users where orders.user_id = users.users_id and " + sql);
                ResultSet rs = db.query("select orders.date_purchased, orders.orders_id, orders.orders_total, orders.orders_tax, orders.payment_method, users.users_username, stations.stations_name,orders.orders_status,  orders.synchronized from orders, users, stations where orders.users_id = users.users_id and orders.stations_id = stations.stations_id and orders.orders_id = " +
                                        orderId);

                Vector temp = new Vector();

                while (rs.next()) {
                    Object[] order = new Object[columnNames.length];
                    order[0] = DateFormat.getDateTimeInstance().format(rs.
                            getTimestamp(1));
                    order[1] = new Integer(rs.getInt(2));
                    order[2] = new Double(rs.getDouble(3));
                    order[3] = new Double(rs.getDouble(4));
                    order[4] = rs.getString(5);
                    order[5] = rs.getString(6);
                    order[6] = rs.getString(7);
                    String status = "";

                    if (rs.getBoolean(8) == true) {
                        status += "C";
                    }
                    if (rs.getBoolean(9) == false) {
                        status += "S";
                    }
                    order[7] = status;
                    temp.add(order);
                }

                if (temp.size() > 0) {
                    data = new Object[temp.size()][];

                    for (int i = 0; i < temp.size(); i++) {
                        data[i] = (Object[]) temp.elementAt(i);
                    }

                    row = 0;
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        return row;
    }