Examples of JDBQuery


Examples of com.commander4j.db.JDBQuery

  }

  private void buildSQL() {

    JDBQuery.closeStatement(listStatement);
    JDBQuery query = new JDBQuery(Common.selectedHostID, Common.sessionID);

    query.clear();
    String schemaName = Common.hostList.getHost(Common.selectedHostID).getDatabaseParameters().getjdbcDatabaseSchema();
    query.addText(JUtility.substSchemaName(schemaName, "select * from {schema}SYS_ARCHIVE order by ARCHIVE_ID"));
    query.applyRestriction(false, "none", 0);
    query.bindParams();

    listStatement = query.getPreparedStatement();
  }
View Full Code Here

Examples of com.commander4j.db.JDBQuery

    uomList.add(new JDBUom(Common.selectedHostID, Common.sessionID));
    uomList.addAll(u.getInternalUoms());

    initGUI();

    JDBQuery query = new JDBQuery(Common.selectedHostID, Common.sessionID);
    query.clear();
    query.addText(JUtility.substSchemaName(schemaName, "select * from {schema}APP_PROCESS_ORDER where 1=2"));
    query.bindParams();
    listStatement = query.getPreparedStatement();
    populateList();

    JLabel4j_std label = new JLabel4j_std();
    label.setText(lang.get("lbl_Process_Order_Required_Resource"));
    label.setHorizontalAlignment(SwingConstants.TRAILING);
View Full Code Here

Examples of com.commander4j.db.JDBQuery

    PreparedStatement result;
   
    String temp = "";

    JDBQuery query = new JDBQuery(Common.selectedHostID, Common.sessionID);
    query.clear();

    temp = Common.hostList.getHost(Common.selectedHostID).getSqlstatements().getSQL("JDBProcessOrder.selectWithLimit");

    query.addText(temp);

    query.addParamtoSQL("process_order=", jTextFieldProcessOrder.getText());
    query.addParamtoSQL("material=", jTextFieldMaterial.getText());
    query.addParamtoSQL("status=", jComboBoxStatus.getSelectedItem());
    query.addParamtoSQL("location_id=", jTextFieldLocation.getText());
    query.addParamtoSQL("recipe_id=", jTextFieldRecipe.getText());
    query.addParamtoSQL("description like ", "%" + jTextFieldDescription.getText() + "%");
    query.addParamtoSQL("required_resource = ", jTextFieldRequiredResource.getText());
    query.addParamtoSQL("customer_id=", jTextFieldCustomer.getText());
    query.addParamtoSQL("inspection_id=",jTextFieldInspectionID.getText());
   
    query.addParamtoSQL("required_uom=", ((JDBUom) jComboBoxUOM.getSelectedItem()).getInternalUom());

    if (jCheckBoxDueDateFrom.isSelected())
    {
      query.addParamtoSQL("due_date>=", JUtility.getTimestampFromDate(dueDateFrom.getDate()));
    }
    if (jCheckBoxDueDateTo.isSelected())
    {
      query.addParamtoSQL("due_date<=", JUtility.getTimestampFromDate(dueDateTo.getDate()));
    }


    if (jCheckBoxQuantity.isSelected())
    {
      if (jFormattedTextFieldQuantity.getText().equals("") == false)
      {
        query.addParamtoSQL("required_quantity=", JUtility.stringToBigDecimal(jFormattedTextFieldQuantity.getText().toString()));
      }
    }


    query.appendSort(jComboBoxSortBy.getSelectedItem().toString(), jToggleButtonSequence.isSelected());
    query.applyRestriction(jCheckBoxLimit.isSelected(),Common.hostList.getHost(Common.selectedHostID).getDatabaseParameters().getjdbcDatabaseSelectLimit(), jSpinnerLimit.getValue());
    query.bindParams();
    result = query.getPreparedStatement();
    return result;
  }
View Full Code Here

Examples of com.commander4j.db.JDBQuery

  }

  private void buildSQL() {
   
    JDBQuery.closeStatement(listStatement);
    JDBQuery query = new JDBQuery(Common.selectedHostID, Common.sessionID);

    query.clear();
    String schemaName = Common.hostList.getHost(Common.selectedHostID).getDatabaseParameters().getjdbcDatabaseSchema();
    query.addText(JUtility.substSchemaName(schemaName, "select * from {schema}SYS_PRINTERS order by printer_id"));
    query.applyRestriction(false, "none", 0);
    query.bindParams();

    listStatement = query.getPreparedStatement();
  }
View Full Code Here

Examples of com.commander4j.db.JDBQuery

      }
    }
   
    resultSQL = startSQL + " " + fieldsSQL + " " + joinSQL + " " + whereSQL + " " + groupSQL + " "+sqlHaving;

    JDBQuery query = new JDBQuery(Common.selectedHostID, Common.sessionID);
    query.setSqlText(resultSQL);
    query.applyRestriction(jCheckBoxLimit.isSelected(),Common.hostList.getHost(Common.selectedHostID).getDatabaseParameters().getjdbcDatabaseSelectLimit(), jSpinnerLimit.getValue());
    if (dateParams > 0)
    {
      if (dateParams == 1)
      {
        if (checkBoxSampleFrom.isSelected())
        {
          query.addParameter(JUtility.getTimestampFromDate(dateSampleFrom.getDate()));
        }
        if (checkBoxSampleTo.isSelected())
        {
          query.addParameter(JUtility.getTimestampFromDate(dateSampleTo.getDate()));
        }
      } else
      {
        if (dateParams == 2)
        {
          query.addParameter(JUtility.getTimestampFromDate(dateSampleFrom.getDate()));
          query.addParameter(JUtility.getTimestampFromDate(dateSampleTo.getDate()));
        }
      }
    }

    query.bindParams();
    result = query.getPreparedStatement();
    System.out.println(resultSQL);

    return result;
  }
View Full Code Here

Examples of com.commander4j.db.JDBQuery

    });
    jButtonAssign.setText(lang.get("btn_Assign_to_MHN"));
    jButtonAssign.setBounds(245, 138, 120, 32);
    jDesktopPane1.add(jButtonAssign);
    this.setTitle("[" + mhnnumber + "]");
    JDBQuery query = new JDBQuery(Common.selectedHostID, Common.sessionID);
    query.clear();
    query.addText(JUtility.substSchemaName(schemaName, "select * from {schema}APP_PALLET where 1=2"));
    query.applyRestriction(false, "none", 0);
    query.bindParams();
    listStatement = query.getPreparedStatement();
    populateList();

    setSequence(dlg_sort_descending);

    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
View Full Code Here

Examples of com.commander4j.db.JDBQuery

  {

    JDBQuery.closeStatement(listStatement);
    String temp = "";

    JDBQuery query = new JDBQuery(Common.selectedHostID, Common.sessionID);
    query.clear();

    temp = Common.hostList.getHost(Common.selectedHostID).getSqlstatements().getSQL("JDBPallet.selectWithExpiry");

    query.addText(temp);

    query.addParamtoSQL("confirmed = ", "Y");


    if (jTextFieldSSCC.getText().equals("") == false)
    {
      query.addParamtoSQL("sscc = ", jTextFieldSSCC.getText());
    }

    if (jTextFieldMaterial.getText().equals("") == false)
    {
      query.addParamtoSQL("material = ", jTextFieldMaterial.getText());
    }

    if (jTextFieldCustomer.getText().equals("") == false)
    {
      query.addParamtoSQL("customer_id=", jTextFieldCustomer.getText());
    }

    if (jTextFieldBatch.getText().equals("") == false)
    {
      query.addParamtoSQL("batch_number like ", jTextFieldBatch.getText());
    }

    if (jTextFieldProcessOrder.getText().equals("") == false)
    {
      query.addParamtoSQL("process_order = ", jTextFieldProcessOrder.getText());
    }

    if (jTextFieldLocation.getText().equals("") == false)
    {
      query.addParamtoSQL("location_id = ", jTextFieldLocation.getText());
    }

    if (jTextFieldEAN.getText().equals("") == false)
    {
      query.addParamtoSQL("EAN = ", jTextFieldEAN.getText());
    }

    if (jTextFieldDespatch_No.getText().equals("") == false)
    {
      query.addParamtoSQL("DESPATCH_NO = ", jTextFieldDespatch_No.getText());
    }

    if (jTextFieldVariant.getText().equals("") == false)
    {
      query.addParamtoSQL("variant = ", jTextFieldVariant.getText());
    }

    query.addParamtoSQL("uom=", ((JDBUom) jComboBoxUOM.getSelectedItem()).getInternalUom());

    query.addParamtoSQL("status=", ((String) jComboBoxPalletStatus.getSelectedItem()).toString());

    if (jCheckBoxQuantity.isSelected())
    {
      if (jFormattedTextFieldQuantity.getText().equals("") == false)
      {
        query.addParamtoSQL("quantity=",JUtility.stringToBigDecimal(jFormattedTextFieldQuantity.getText().toString()));
      }
    }

    if (jCheckBoxDOMFrom.isSelected())
    {
      query.addParamtoSQL("date_of_manufacture>=", JUtility.getTimestampFromDate(domDateFrom.getDate()));
    }

    if (jCheckBoxDOMTo.isSelected())
    {
      query.addParamtoSQL("date_of_manufacture<=", JUtility.getTimestampFromDate(domDateTo.getDate()));
    }

    if (jCheckBoxExpiryFrom.isSelected())
    {
      query.addParamtoSQL("expiry_date>=", JUtility.getTimestampFromDate(expiryDateFrom.getDate()));
    }

    if (jCheckBoxExpiryTo.isSelected())
    {
      query.addParamtoSQL("expiry_date<=", JUtility.getTimestampFromDate(expiryDateTo.getDate()));
    }

    Integer i;

    try
    {
      i = Integer.valueOf(jFormattedTextFieldQuantity.getText());
      query.addParamtoSQL("quantity=", i);
    }
    catch (Exception e)
    {
    }


    query.appendSort(jComboBoxSortBy.getSelectedItem().toString(), jToggleButtonSequence.isSelected());
    query.applyRestriction(jCheckBoxLimit.isSelected(), Common.hostList.getHost(Common.selectedHostID).getDatabaseParameters().getjdbcDatabaseSelectLimit(), jSpinnerLimit.getValue());
    query.bindParams();
    listStatement =  query.getPreparedStatement();
  }
View Full Code Here

Examples of com.commander4j.db.JDBQuery

  }
 
  private void buildSQL() {
   
    JDBQuery.closeStatement(listStatement);
    JDBQuery query = new JDBQuery(Common.selectedHostID, Common.sessionID);
    query.clear();

    query.addText(JUtility.substSchemaName(schemaName, "select * from {schema}APP_QM_INSPECTION"));
    query.addParamtoSQL("inspection_id =", textFieldInspectionID.getText());
    query.addParamtoSQL("description like ", "%"+textFieldDescription.getText()+"%");

    query.appendSort("inspection_id", true);
   
    query.applyRestriction(chckbxLimit.isSelected(),Common.hostList.getHost(Common.selectedHostID).getDatabaseParameters().getjdbcDatabaseSelectLimit(), spinnerLimit.getValue());
   
    query.bindParams();
    listStatement = query.getPreparedStatement();
  }
View Full Code Here

Examples of com.commander4j.db.JDBQuery

    final JScrollPane scrollPane = new JScrollPane();
    scrollPane.setBounds(10, 30, 150, 255);
    desktopPane.add(scrollPane);

    JDBQuery query = new JDBQuery(Common.selectedHostID, Common.sessionID);
    query.clear();
    query.addText(JUtility.substSchemaName(schemaName, "select * from {schema}APP_PALLET where 1=2"));
    query.bindParams();
    listStatement = query.getPreparedStatement();

    list_despatch = new JList4j();
    list_despatch.addListSelectionListener(new ListSelectionListener()
    {
      public void valueChanged(ListSelectionEvent e)
View Full Code Here

Examples of com.commander4j.db.JDBQuery

    catch (SQLException e)
    {
      e.printStackTrace();
    }

    JDBQuery q = new JDBQuery(Common.selectedHostID, Common.sessionID);
    String temp = "";
    q.clear();

    temp = Common.hostList.getHost(Common.selectedHostID).getSqlstatements().getSQL("JDBPallet.select");

    q.addText(temp);

    if (list_despatch.getModel().getSize() > 0)
    {
      if (list_despatch.getSelectedIndex() >= 0)
      {
        JDBDespatch d = (JDBDespatch) list_despatch.getSelectedValue();

        q.addParamtoSQL("despatch_no <> ", d.getDespatchNo());

      }
    }

    if (textFieldDespatchNo.getText().equals("") == false)
    {
      q.addParamtoSQL("despatch_No = ", textFieldDespatchNo.getText());
    }

    if (textFieldDespatchLocationFrom.getText().equals("") == false)
    {
      q.addParamtoSQL("location_id = ", textFieldDespatchLocationFrom.getText());
    }

    if (textFieldSSCC.getText().equals("") == false)
    {
      q.addParamtoSQL("sscc like ", textFieldSSCC.getText());
    }

    if (textFieldMaterial.getText().equals("") == false)
    {
      q.addParamtoSQL("material like ", textFieldMaterial.getText());
    }

    if (textFieldBatch.getText().equals("") == false)
    {
      q.addParamtoSQL("batch_number like ", textFieldBatch.getText());
    }

    q.addParamtoSQL("Confirmed = ", "Y");

    q.addParamtoSQL("status=", ((String) comboBoxPalletStatus.getSelectedItem()).toString());


    q.appendSort("sscc", "asc");
    q.applyRestriction(jCheckBoxLimit.isSelected(), Common.hostList.getHost(Common.selectedHostID).getDatabaseParameters().getjdbcDatabaseSelectLimit(), spinnerUnassignedLimit.getValue());
    q.bindParams();

    listStatement = q.getPreparedStatement();
  }
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.