Package edu.spbstu.hoteldb.interfaces

Examples of edu.spbstu.hoteldb.interfaces.SQLQuery


    String lang = ((ChoiceBox<String>) args.get(5)).getValue();
    if ((email.compareTo("") == 0) || (pass.compareTo("") == 0)
        || (name.compareTo("") == 0)) {
      textArea.appendText("Login, password and name are required to complete registration.");
    } else {
      SQLQuery nuu = new NewUserUpdate(connect, textArea);
      List<Object> args = new LinkedList<Object>();
      args.add(login); args.add(email); args.add(pass); args.add(name); args.add(country); args.add(lang);
      try {
        nuu.prepareQuery(args);
        nuu.doQuery();
        main.setPanel(PanelType.LoginPanel, null);       
      } catch (SQLException e) {
        e.printStackTrace();
      }
    }
View Full Code Here


    connect = connection;
  }

  @Override
  public void handle(ActionEvent arg0) {
    SQLQuery query = new SearchRoomQuery(connect, results);
    LinkedList<Object> args = new LinkedList<Object>();
    Integer pc = Integer.MAX_VALUE;
    Integer cost = Integer.MAX_VALUE;
    try {
      pc = Integer.parseInt(tfpcount.getText());
    } catch (NumberFormatException e) {
      // ignore
    }
    try {
      cost = Integer.parseInt(tfcost.getText());
    } catch (NumberFormatException e) {
      // ignore
    }
    args.addLast(pc);
    args.addLast(cost);
    args.addLast(new Boolean(chckbxdesc.isSelected()));
    args.addLast(chbbar.getValue());

    try {
      query.prepareQuery(args);
      query.doQuery();
      query.close();
    } catch (SQLException e) {
      results.appendText(e.getMessage() + '\n');
      e.printStackTrace();
    }
  }
View Full Code Here

      return;
    }
   
    arg.add(from.toString()); arg.add(to.toString());
    try {
      SQLQuery query = new HistorySearchQuery(connect, results);
      query.prepareQuery(arg);
      query.doQuery();
      query.close();
    } catch (SQLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
View Full Code Here

  @Override
  public void handle(ActionEvent event) {
    try {
      Integer id = Integer.parseInt(textField.getText());
      Integer roomnum = Integer.parseInt(textField.getText());
      SQLQuery bu = new BookUpdate(null, textArea);
      List<Object> args = new LinkedList<Object>();
      args.add(id); args.add(roomnum);
      bu.prepareQuery(args);
      bu.doQuery();
    } catch (NumberFormatException e) {
      textArea.appendText("invalid room number");
    } catch (SQLException e) {
      e.printStackTrace();
    }
View Full Code Here

  public void handle(ActionEvent arg0) {
    List<Object> arg = new LinkedList<Object>();
    arg.add(((TextField) args.get(0)).getText());
    arg.add(((TextField) args.get(1)).getText());
    try {
      SQLQuery query = new PersonnelSearchQuery(results, connect);
      query.prepareQuery(arg);
      query.doQuery();
      query.close();
    } catch (SQLException e) {
      results.appendText("invalid query\n");
      e.printStackTrace();
    }
  }
View Full Code Here

      results.appendText("from date >= to date\n");
      return;
    }
    arg.add(from.toString()); arg.add(to.toString());
    try {
      SQLQuery query = new IncomeCalcQuery(connect, results);
      query.prepareQuery(arg);
      query.doQuery();
      query.close();
    } catch (SQLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
View Full Code Here

    args = arg;
  }
 
  @Override
  public void handle(ActionEvent arg0) {
    SQLQuery query = new ClientSearchQuery(results, connect);
    try {
      List<Object> arg = new LinkedList<Object>();
      arg.add(((TextField) args.get(0)).getText());
      arg.add(((TextField) args.get(1)).getText());
      query.prepareQuery(arg);
      query.doQuery();
      query.close();
    } catch (SQLException e) {
      results.appendText("invalid query\n");
      e.printStackTrace();
    }
  }
View Full Code Here

TOP

Related Classes of edu.spbstu.hoteldb.interfaces.SQLQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.