Examples of DQSPServer


Examples of server.DQSPServer

  XYDataset createGlobalDataset(Integer year) {

    TimeSeriesCollection dataset = new TimeSeriesCollection();

    // calling the server
    DQSPServer s = new DQSPServerI();
    // getting a connection with database
    Connection con = DBConnexion.getConnection();

    for (String st : s.listOfAirports()) {
      if (s.numberOfPassengers(st) != 0) {
        try {
          PreparedStatement ps = con
              .prepareStatement("SELECT count(*) num, MONTH(r.`date`) mois, YEAR(r.`date`) annee FROM reclamation r WHERE r.`nomAeroport`=? AND YEAR(r.`date`)=?");
          ps.setString(1, st);
          ps.setInt(2, year);

          ResultSet rs = ps.executeQuery();
          while (rs.next()) {
            TimeSeries serie = new TimeSeries(st);
            try {
              serie.add(
                  new Month(rs.getInt("mois"), year
                      .intValue()),
                  rs.getInt("num") / s.numberOfPassengers(st));
            } catch (Exception ex) {
              __app.getMainWindow().showNotification(
                  "Notification", "No Data",
                  Window.Notification.TYPE_TRAY_NOTIFICATION);
            }
View Full Code Here

Examples of server.DQSPServer

  XYDataset createThemeDataset(Integer year, String theme) {

    TimeSeriesCollection dataset = new TimeSeriesCollection();

    // calling the server
    DQSPServer s = new DQSPServerI();
    // getting a connection with database
    Connection con = DBConnexion.getConnection();

    for (String st : s.listOfAirports()) {
      if (s.numberOfPassengers(st) != 0) {
        try {
          PreparedStatement ps = con
              .prepareStatement("SELECT count(*) num, MONTH(r.`date`) mois, YEAR(r.`date`) annee FROM reclamation r WHERE r.`nomAeroport`=? AND YEAR(r.`date`)=? AND r.`remarque`=?");
          ps.setString(1, st);
          ps.setInt(2, year);
          ps.setString(3, theme);

          ResultSet rs = ps.executeQuery();
          while (rs.next()) {
            TimeSeries serie = new TimeSeries(st);
            try {
              serie.add(
                  new Month(rs.getInt("mois"), year
                      .intValue()),
                  rs.getInt("num") / s.numberOfPassengers(st));
            } catch (Exception ex) {
              __app.getMainWindow().showNotification(
                  "Notification", "No data",
                  Window.Notification.TYPE_TRAY_NOTIFICATION);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.