public static void main(String[] args) {
   try {
     inclusiveExceptionThrown();
   } catch (IOException | SQLException e) {
     System.err.println(e.getClass());
   }
 }
예제 #2
0
 public viewSchedules() {
   super("View Schedules", "Total Schedule", "Group Schedule", "Team Schedule", "Final Schedule");
   EXIT_OPTION = EXIT_VALUE;
   try {
     mmgr = new MatchManager();
     tmgr = new TeamManager();
     gmgr = new GroupManager();
   } catch (IOException | SQLException ex) {
     System.out.println("ERROR - " + ex.getMessage());
   }
 }
 public Object executeFunction(CommandLine line) {
   if (!line.hasOption("name")) {
     ShellEnvironment.println("Required argument --name is missing.");
     return null;
   }
   try {
     String name = line.getOptionValue("name");
     migrateCheckConstraint(name);
   } catch (IOException | SQLException | InterruptedException ex) {
     ex.printStackTrace();
   }
   return null;
 }
예제 #4
0
 public boolean insert_update(Personas_avatar pa, String dml) throws SQLException {
   Boolean control = false;
   try {
     con = new Conexion();
     ps = con.getConnection().prepareStatement("select f_personas_avatar(?,?,?);");
     ps.setString(1, dml);
     ps.setLong(2, pa.getCedula());
     if (pa.getFoto() != null) {
       FileInputStream fis = new FileInputStream(pa.getFoto());
       ps.setBinaryStream(3, fis, (int) pa.getFoto().length());
     } else {
       ps.setNull(3, java.sql.Types.ARRAY);
     }
     control = ps.execute();
     ps.close();
   } catch (IOException | SQLException e) {
     e.printStackTrace();
     System.err.println(e.getClass().getName() + ": " + e.getMessage());
     System.exit(0);
   } finally {
     con.close();
   }
   return control;
 }
예제 #5
0
 public byte[] select(Long cedula) throws SQLException {
   byte[] foto = null;
   try {
     con = new Conexion();
     ps =
         con.getConnection()
             .prepareStatement("select foto from f_personas_avatar('select',?,null);");
     ps.setLong(1, cedula);
     try (ResultSet rs = ps.executeQuery()) {
       while (rs.next()) {
         foto = rs.getBytes("foto");
       }
       rs.close();
     }
     ps.close();
   } catch (IOException | SQLException e) {
     e.printStackTrace();
     System.err.println(e.getClass().getName() + ": " + e.getMessage());
     System.exit(0);
   } finally {
     con.close();
   }
   return foto;
 }
  private void openFile() {
    try {
      String[] client =
          global
              .root
              .getHeaderRootPanel1()
              .getClientComboBox()
              .getSelectedItem()
              .toString()
              .split(", ");
      String matterName =
          global
              .root
              .headerRootPanel1
              .getMatterComboBox()
              .getSelectedItem()
              .toString()
              .substring(
                  0,
                  global
                          .root
                          .headerRootPanel1
                          .getMatterComboBox()
                          .getSelectedItem()
                          .toString()
                          .length()
                      - 13);
      Desktop desktop = Desktop.getDesktop();
      global.MattersRS.first();
      File openFile =
          new File(
              global.archivePath
                  + client[0].trim()
                  + " "
                  + client[1].trim()
                  + "_"
                  + global.ClientIDRS.getInt("ClientID")
                  + "\\"
                  + matterName
                  + "_"
                  + global.ActivityDetailRS.getInt("MatterID")
                  + "\\"
                  + global.ActivityDetailRS.getString("File"));

      if (openFile.exists()) {
        desktop.open(openFile);
      } else {
        WebOptionPane.showMessageDialog(
            global.root, "Sorry, unable to locate file", "Error", WebOptionPane.ERROR_MESSAGE);
      }

    } catch (IOException | SQLException ex) {
      StringWriter error = new StringWriter();
      ex.printStackTrace(new PrintWriter(error));
      SystemCrashDialog crash =
          new SystemCrashDialog(
              global.root,
              true,
              global,
              global.root.getHeaderRootPanel1().getClientComboBox().getSelectedItem().toString(),
              global.root.getHeaderRootPanel1().getMatterComboBox().getSelectedItem().toString(),
              "Err0222",
              error.toString());
    }
  }