Examples of JDBControl


Examples of com.commander4j.db.JDBControl

  public static void init() {
   
    defaultColumnPrefs.put(999, new RenderColumnPrefs(JLabel.CENTER,Common.color_listFontStandard,Common.color_tablerow3,Common.color_tablerow2,100));
   
    JDBControl control = new JDBControl(Common.selectedHostID, Common.sessionID);

    control.setSystemKey("PASSWORD EXPIRY");
    if (control.getProperties() == true)
    {
      user_password_expiry_days = Integer.parseInt(control.getKeyValue());
    }

    control.setSystemKey("PASSWORD ATTEMPTS");
    if (control.getProperties() == true)
    {
      user_max_password_attempts = Integer.parseInt(control.getKeyValue());
    }
   
    for (int x=0;x<dataTypes.length;x++)
    {
      datatypeClass.put(dataTypes[x], dataClasses[x]);
View Full Code Here

Examples of com.commander4j.db.JDBControl

    }
  }

  public static void init()
  {
    JDBControl ctrl = new JDBControl(Common.selectedHostID, Common.sessionID);
    ctrl.getProperties("COMPANY NAME");
    stdparams.put("COMPANY_NAME", ctrl.getKeyValue());
    ctrl.getProperties("PLANT");
    stdparams.put("PLANT", ctrl.getKeyValue());
    stdparams.put("SUBREPORT_DIR", System.getProperty("user.dir") + File.separator + "reports" + File.separator);
    System.getProperty("user.dir");
    ctrl.getProperties("LABEL_HEADER_COMMENT");

    DefaultJasperReportsContext jasperContext = DefaultJasperReportsContext.getInstance();
    JRPropertiesUtil.getInstance(jasperContext).setProperty("net.sf.jasperreports.awt.ignore.missing.font", "true");
    JRPropertiesUtil.getInstance(jasperContext).setProperty("net.sf. jasperreports.properties", Common.report_path + "default.jasperreports.properties");
View Full Code Here

Examples of com.commander4j.db.JDBControl

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

          JExcel export = new JExcel();
          buildSQL();
          export.saveAs("control.xls", control.getControlDataResultSet(listStatement), Common.mainForm);
        }
      });
      jButtonExcel.setText(lang.get("btn_Excel"));
      jButtonExcel.setMnemonic(lang.getMnemonicChar());
      jButtonExcel.setBounds(331, 275, 106, 30);
View Full Code Here

Examples of com.commander4j.db.JDBControl

    listStatement = query.getPreparedStatement();
  }

  private void populateList(String defaultitem) {

    JDBControl ctrl = new JDBControl(Common.selectedHostID, Common.sessionID);
    buildSQL();
    JDBControlTableModel controltable = new JDBControlTableModel(ctrl.getControlDataResultSet(listStatement));
    TableRowSorter<JDBControlTableModel> sorter = new TableRowSorter<JDBControlTableModel>(controltable);

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

Examples of com.commander4j.db.JDBControl

        jButtonAdd.setBounds(7, 275, 106, 32);
        jButtonAdd.setMnemonic(lang.getMnemonicChar());
        jButtonAdd.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_SYSTEM_KEYS_ADD"));
        jButtonAdd.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            JDBControl ctl = new JDBControl(Common.selectedHostID, Common.sessionID);

            systemKey = JOptionPane.showInputDialog(Common.mainForm, "Enter new System Key");
            if (systemKey != null)
            {
              if (systemKey.equals("") == false)
              {
                systemKey = systemKey.toUpperCase();
                if (ctl.create(systemKey, "", "") == false)
                {
                  JUtility.errorBeep();
                  JOptionPane.showMessageDialog(Common.mainForm, ctl.getErrorMessage(), lang.get("err_Error"), JOptionPane.ERROR_MESSAGE);
                }
                else
                {

                  populateList("");
                  JLaunchMenu.runDialog("FRM_ADMIN_CONTROL_EDIT", systemKey);
                  populateList("");
                }
              }
            }

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

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

              int n = JOptionPane.showConfirmDialog(Common.mainForm, lang.get("dlg_System_Key_Delete")+" " + systemKey + " ?", lang.get("dlg_Confirm"), JOptionPane.YES_NO_OPTION, 0, Common.icon_confirm);
              if (n == 0)
              {
                JDBControl c = new JDBControl(Common.selectedHostID, Common.sessionID);
                c.setSystemKey(systemKey);
                c.delete();
                populateList("");
              }
            }
          }
        });
View Full Code Here

Examples of com.commander4j.db.JDBControl

        public void actionPerformed(ActionEvent evt)
        {

          String schemaFrom = "";
          String schemaTo = "";
          JDBControl ctrl;

          // Source & Destination must be different Hosts//
          setStatusBarText("Validating selected hosts");
          if (hostIDFrom.equals(hostIDTo) == false)
          {

            // Check we can connect to Source //
            setStatusBarText("Connecting to source...");
            if (hstFrom.connect(sessionFrom, hostIDFrom))
            {
             
              // Check we can connect to Destination //
              setStatusBarText("Connecting to destination...");
              if (hstTo.connect(sessionTo, hostIDTo))
              {

                // Check Application Schema Versions are the
                // same in Source and Destination //
                setStatusBarText("Checking schema versions...");
                ctrl = new JDBControl(hostIDFrom, sessionFrom);
                schemaFrom = ctrl.getKeyValue("SCHEMA VERSION");
                ctrl = new JDBControl(hostIDTo, sessionTo);
                schemaTo = ctrl.getKeyValue("SCHEMA VERSION");

                if (schemaFrom.equals(schemaTo))
                {
                  // OK //
                  setStatusBarText("Getting source table names...");
View Full Code Here

Examples of com.commander4j.db.JDBControl

  public static void main(String[] args)
  {
    Logger logger = Logger.getLogger(Start.class);
    JDialogLogin lg;
    JDialogHosts hsts;
    JDBControl ctrl;
    JDBUser user;
    boolean loggedIn = false;
    String passwordMode = "";

    Thread t = Thread.currentThread();
    t.setName("C4J Main");

    System.setProperty("apple.laf.useScreenMenuBar", "true");
    System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Commander4j");
    Common.base_dir = System.getProperty("user.dir");
    Common.sessionID = JUnique.getUniqueID();
    Common.sd.setData(Common.sessionID, "silentExceptions", "No", true);
    Common.applicationMode = "SwingClient";

    JUtility.adjustForLookandFeel();

    JUtility.initLogging("");
    Common.hostList.loadHosts();
    com.commander4j.util.JUpdate.updateCheck();

    JSplashScreenUtils.create();
    JSplashScreenUtils.updateProgress(0, "Initialising");
    JSplashScreenUtils.updateProgress(5, "Starting Logger");
    JSplashScreenUtils.updateProgress(10, "Checking Printers");

    JPrint.init();

    if (JUtility.isValidJavaVersion(Common.requiredJavaVersion) == false)
    {
      JUtility.errorBeep();
      JOptionPane.showMessageDialog(null, "This application requires java version " + Common.requiredJavaVersion + " or higher.\n Detected version is " + System.getProperty("java.version"),
          "Information", JOptionPane.ERROR_MESSAGE);
      System.exit(0);
    }

    JSplashScreenUtils.updateProgress(15, "Setting Look and Feel");

    logger.info("Application starting");
    JSplashScreenUtils.updateProgress(20, "Preparing for Logon");

    JSplashScreenUtils.hide();

    hsts = new JDialogHosts(null);
    hsts.setVisible(false);
    hsts.dispose();

    if (Common.selectedHostID.equals("Cancel") == false)
    {
      if (Common.displaySplashScreen)
      {
        JSplashScreenUtils.show();

        JSplashScreenUtils.updateProgress(25, "Initialising....");
        JSplashScreenUtils.updateProgress(30, "Open SQL Library....");
        JSplashScreenUtils.updateProgress(35, "Building jdbc connection string....");
        JSplashScreenUtils.updateProgress(40, "Loading database SQL statements...");
        JSplashScreenUtils.updateProgress(45, "Open Virtual Views....");
        JSplashScreenUtils.updateProgress(55, "Building jdbc connection string....");
        JSplashScreenUtils.updateProgress(60, "Loading database view statements...");
        JSplashScreenUtils.updateProgress(65, "Loading database view statements...");
        JSplashScreenUtils.updateProgress(70, "Connecting to Host database...");
      }

      if (Common.hostList.getHost(Common.selectedHostID).connect(Common.sessionID, Common.selectedHostID) == true)
      {
        JSplashScreenUtils.updateProgress(75, "Validating Schema Version...");

        JDBSchema schema = new JDBSchema(Common.sessionID, Common.hostList.getHost(Common.selectedHostID));

        schema.validate(true);
        JSplashScreenUtils.updateProgress(80, "Initialising Help Subsystem...");
        JSplashScreenUtils.updateProgress(85, "Loading EAN Barcode definitions...");

        JUtility.initEANBarcode();

        JSplashScreenUtils.updateProgress(90, "Initialising Reporting system...");

        JLaunchReport.init();

        JSplashScreenUtils.updateProgress(95, "Initialising Common values...");

        Common.init();

        JSplashScreenUtils.updateProgress(100, "Loading Logon dialog...");

        JSplashScreenUtils.hide();
        JSplashScreenUtils.remove();

        ctrl = new JDBControl(Common.selectedHostID, Common.sessionID);
        passwordMode = ctrl.getKeyValue("PASSWORD MODE");
       
        if (passwordMode.equals("PASSTHROUGH"))
        {
          user = new JDBUser(Common.selectedHostID, Common.sessionID);
          user.getUserProperties(System.getProperty("user.name"));
View Full Code Here

Examples of com.commander4j.db.JDBControl

  public static void init() {
   
    defaultColumnPrefs.put(999, new RenderColumnPrefs(JLabel.CENTER,Common.color_listFontStandard,Common.color_tablerow3,Common.color_tablerow2,100));
   
    JDBControl control = new JDBControl(Common.selectedHostID, Common.sessionID);

    control.setSystemKey("PASSWORD EXPIRY");
    if (control.getProperties() == true)
    {
      user_password_expiry_days = Integer.parseInt(control.getKeyValue());
    }

    control.setSystemKey("PASSWORD ATTEMPTS");
    if (control.getProperties() == true)
    {
      user_max_password_attempts = Integer.parseInt(control.getKeyValue());
    }
   
    for (int x=0;x<dataTypes.length;x++)
    {
      datatypeClass.put(dataTypes[x], dataClasses[x]);
View Full Code Here

Examples of com.commander4j.db.JDBControl

    JDBMaterialLocation matlocn = new JDBMaterialLocation(getHostID(), getSessionID());
    JDBLocation locn = new JDBLocation(getHostID(), getSessionID());
    JDBMaterialUom matuom = new JDBMaterialUom(getHostID(), getSessionID());
    JDBUom uomdb = new JDBUom(getHostID(), getSessionID());
    JDBInterface inter = new JDBInterface(getHostID(), getSessionID());
    JDBControl ctrl = new JDBControl(getHostID(), getSessionID());
    JDBMaterialCustomerData matcustdata = new JDBMaterialCustomerData(getHostID(), getSessionID());
    JDBCustomer cust = new JDBCustomer(getHostID(), getSessionID());

    String defaultBatchStatus = ctrl.getKeyValue("DEFAULT BATCH STATUS");

    inter.getInterfaceProperties("Material Definition", "Input");

    material = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/materialDefinition/material").trim());
    setErrorMessage("Material " + material + " updated.");
View Full Code Here

Examples of com.commander4j.db.JDBControl

                    }

                    if (updateCtrl)
                    {
                      JDBControl ctrl = new JDBControl(Common.selectedHostID, Common.sessionID);
                      if (ctrl.getProperties("SCHEMA VERSION"))
                      {
                        ctrl.setKeyValue(String.valueOf(updrst.schema_requiredVersion));
                        ctrl.update();
                      } else
                      {
                        ctrl.create("SCHEMA VERSION", String.valueOf(updrst.schema_requiredVersion), "Schema Version");
                      }
                      JOptionPane.showMessageDialog(me, "Schema Version now set to " + String.valueOf(JVersion.getSchemaVersion()), "Control Table", JOptionPane.INFORMATION_MESSAGE);

                    }

                  }
                } else
                {
                  JOptionPane.showMessageDialog(me, "No Schema update Required", "Connection to (" + hst.getSiteDescription() + ")", JOptionPane.INFORMATION_MESSAGE);
                }

                if (updrst.program_updateRequired)
                {
                  JDBControl ctrl = new JDBControl(Common.selectedHostID, Common.sessionID);

                  if (ctrl.getProperties("PROGRAM VERSION"))
                  {
                    ctrl.setKeyValue(JVersion.getProgramVersion());
                    ctrl.update();
                  } else
                  {
                    ctrl.create("PROGRAM VERSION", JVersion.getProgramVersion(), "Program Version");
                  }
                  JOptionPane.showMessageDialog(me, "Program Version now set to " + JVersion.getProgramVersion(), "Control Table", JOptionPane.INFORMATION_MESSAGE);

                }
                Common.hostList.getHost(Common.selectedHostID).disconnect(Common.sessionID);
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.