Package com.commander4j.db

Examples of com.commander4j.db.JDBArchive


    listStatement = query.getPreparedStatement();
  }

  private void populateList(String defaultitem) {

    JDBArchive archive = new JDBArchive(Common.selectedHostID, Common.sessionID);
    buildSQL();
    JDBArchiveDataTableModel controltable = new JDBArchiveDataTableModel(archive.getArchiveDataResultSet(listStatement));
    TableRowSorter<JDBArchiveDataTableModel> sorter = new TableRowSorter<JDBArchiveDataTableModel>(controltable);

    jTable1.setRowSorter(sorter);
    jTable1.setModel(controltable);
View Full Code Here


        jButtonAdd.setBounds(2, 275, 115, 32);
        jButtonAdd.setMnemonic(lang.getMnemonicChar());
        jButtonAdd.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_ARCHIVE_ADD"));
        jButtonAdd.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            JDBArchive arch = new JDBArchive(Common.selectedHostID, Common.sessionID);

            archID = JOptionPane.showInputDialog(Common.mainForm, lang.get("dlg_Archive_ID_Input"));
            if (archID != null) {
              if (archID.equals("") == false) {
                archID = archID.toUpperCase();
                arch.clear();
                if (arch.create(archID) == false) {
                  JUtility.errorBeep();
                  JOptionPane.showMessageDialog(Common.mainForm, arch.getErrorMessage(), lang.get("err_Error"), JOptionPane.ERROR_MESSAGE);
                } else {
                  arch.update();
                  populateList("");
                  JLaunchMenu.runDialog("FRM_ADMIN_ARCHIVE_EDIT", archID);
                  populateList("");
                }
              }
            }

          }
        });
      }
      {
        jButtonDelete = new JButton4j(Common.icon_delete);
        this.getContentPane().add(jButtonDelete);
        jButtonDelete.setText(lang.get("btn_Delete"));
        jButtonDelete.setBounds(236, 275, 115, 30);
        jButtonDelete.setMnemonic(lang.getMnemonicChar());
        jButtonDelete.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_ARCHIVE_DELETE"));
        jButtonDelete.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            int row = jTable1.getSelectedRow();
            if (row >= 0) {

              archID = jTable1.getValueAt(row, 0).toString();

              int n = JOptionPane.showConfirmDialog(Common.mainForm, lang.get("dlg_Archive_ID_Delete") + " " + archID + " ?", lang.get("dlg_Confirm"), JOptionPane.YES_NO_OPTION, 0, Common.icon_confirm);
              if (n == 0) {
                JDBArchive c = new JDBArchive(Common.selectedHostID, Common.sessionID);
                c.setArchiveID(archID);
                c.delete();
                populateList("");
              }
            }
          }
        });
      }
      {
        jButtonPrint = new JButton4j(Common.icon_report);
        this.getContentPane().add(jButtonPrint);
        jButtonPrint.setText(lang.get("btn_Print"));
        jButtonPrint.setBounds(587, 275, 115, 30);
        jButtonPrint.setMnemonic(lang.getMnemonicChar());
        jButtonPrint.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("RPT_ARCHIVE"));
        jButtonPrint.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            JLaunchReport.runReport("RPT_ARCHIVE", null, "", null, "");
          }
        });
      }
      {
        jButtonHelp = new JButton4j(Common.icon_help);
        this.getContentPane().add(jButtonHelp);
        jButtonHelp.setText(lang.get("btn_Help"));
        jButtonHelp.setBounds(704, 275, 115, 30);
        jButtonHelp.setMnemonic(lang.getMnemonicChar());

      }
      {
        jButtonExcel = new JButton4j(Common.icon_XLS);
        jButtonExcel.addActionListener(new ActionListener() {
          public void actionPerformed(final ActionEvent e) {
            JDBArchive arch = new JDBArchive(Common.selectedHostID, Common.sessionID);

            JExcel export = new JExcel();
            buildSQL();
            export.saveAs("archive.xls", arch.getArchiveDataResultSet(listStatement), Common.mainForm);
          }
        });
        jButtonExcel.setText(lang.get("btn_Excel"));
        jButtonExcel.setMnemonic(lang.getMnemonicChar());
        jButtonExcel.setBounds(470, 275, 115, 30);
        getContentPane().add(jButtonExcel);
      }

      JButton4j button4jRun = new JButton4j(Common.icon_execute);
      button4jRun.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          int row = jTable1.getSelectedRow();
          if (row >= 0) {

            archID = jTable1.getValueAt(row, 0).toString();

            JDBArchive c = new JDBArchive(Common.selectedHostID, Common.sessionID);
            c.runManual(archID);
            //String test = c.reportData();
            populateList(archID);
          }
        }
      });
View Full Code Here

        JButton4j jButtonRun = new JButton4j(Common.icon_execute);
        jButtonRun.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            update();
            JDBArchive c = new JDBArchive(Common.selectedHostID, Common.sessionID);
            c.runManual(larchiveID);
          }
        });
        jButtonRun.setText(lang.get("btn_Run"));
        jButtonRun.setMnemonic(KeyEvent.VK_H);
        jButtonRun.setBounds(222, 222, 126, 32);
View Full Code Here

    try
    {
      if (cache.containsKey(row)==false)
      {
        mResultSet.absolute(row + 1);
        final JDBArchive prow = new JDBArchive(Common.selectedHostID, Common.sessionID);
        prow.getPropertiesfromResultSet(mResultSet);
        cache.put(row, prow);
      }

      switch (col)
      {
View Full Code Here

          {
            backupMessageRetention = 30;
          }
         
          logger.debug("Initiating data archiving....");
          JDBArchive c = new JDBArchive(getHostID(), getSessionID());           
          c.runSQLJobList();
          String archiveReportString = c.reportData();
          c=null;
          logger.debug("Data archiving complete....");
         
          logger.debug("Disconnecting from database.");
          Common.hostList.getHost(getHostID()).disconnectAll();
View Full Code Here

TOP

Related Classes of com.commander4j.db.JDBArchive

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.