Examples of DataConnection


Examples of it.eng.spago.dbaccess.sql.DataConnection

   * @return  The Domain ID
   */
    private Integer findSBIDomainValueID(String domainCode, String valueCode ){
      SQLCommand cmd = null;
    DataResult dr = null;
    DataConnection dataConnection = null;
    Integer returnValue = null;
    try {
      IDomainDAO domdao = DAOFactory.getDomainDAO();
      Domain dom = domdao.loadDomainByCodeAndValue(domainCode, valueCode);
      returnValue = dom.getValueId();
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.dataeditor.util.DataConnection

    // create JMenuItem to add a connection between two Operators...
    final JMenuItem addConnectionMI = new JMenuItem(
    "Add connection between two operators");
    addConnectionMI.addActionListener(new ActionListener() {
      public void actionPerformed(final ActionEvent ae) {
        connectionMode = new DataConnection(myself);
      }
    });

    // create JMenuItem to add RDFTerm-Operator...
    final JMenuItem rdfTermOpMI = new JMenuItem("RDFTerm");
View Full Code Here

Examples of net.sf.jftp.net.DataConnection

                }
                else
                {
                    Transfer d = (Transfer) o;

                    DataConnection con = d.getDataConnection();
                    con.getCon().work = false;

                    try
                    {
                        con.sock.close();
View Full Code Here

Examples of net.sf.jftp.net.DataConnection

                }

                Transfer d = (Transfer) o;
                d.pause = true;

                DataConnection con = d.getDataConnection();

                try
                {
                    con.sock.close();
                }
View Full Code Here

Examples of nu.lazy8.ledger.jdbc.DataConnection

   * @param  useCustomer  Description of the Parameter
   */
  public AccountPeriodTable(JFrame view, int CompId, java.util.Date periodStart,
      java.util.Date periodStop, int periodType, int numPeriods, boolean useCustomer) {
//Log.log(Log.DEBUG,this,"AccountPeriodTable="+periodType + ";"+periodStart + ";" +periodStop);
    DataConnection dc = DataConnection.getInstance(view);
    if (dc == null || !dc.bIsConnectionMade) {
      return;
    }
    Calendar cPeriodStart = Calendar.getInstance();
    cPeriodStart.setTime(periodStart);
    String periodDescription = "";
    Calendar selectStartDate = Calendar.getInstance();
    Calendar selectStopDate = Calendar.getInstance();
    SimpleDateFormat sd;

    if (periodType == PERIOD_ALL || periodType == PERIOD_GIVEN) {
      numPeriods = 1;
    }

    for (int i = 0; i < numPeriods; i++) {
      selectStartDate.setTime(periodStart);
      selectStopDate.setTime(periodStart);
      switch (periodType) {
        case PERIOD_DAY:
          selectStartDate.add(Calendar.DATE, i);
          selectStopDate.add(Calendar.DATE, i);
          periodDescription = DateField.ConvertDateToLocalizedString(selectStartDate.getTime());
          break;
        case PERIOD_WEEK:
          selectStartDate.add(Calendar.DATE, i * 7);
          selectStopDate.add(Calendar.DATE, ((i + 1) * 7) - 1);
          periodDescription = DateField.ConvertDateToLocalizedString(selectStartDate.getTime());
          break;
        case PERIOD_BIWEEK:
          selectStartDate.add(Calendar.DATE, i * 14);
          selectStopDate.add(Calendar.DATE, ((i + 1) * 14) - 1);
          periodDescription = DateField.ConvertDateToLocalizedString(selectStartDate.getTime());
          break;
        case PERIOD_MONTH:
          selectStartDate.add(Calendar.MONTH, i);
          selectStopDate.add(Calendar.MONTH, i + 1);
          selectStopDate.add(Calendar.DATE, -1);
          sd = new SimpleDateFormat("yyyy.MMM");
          periodDescription = sd.format(selectStartDate.getTime());
          break;
        case PERIOD_BIMONTH:
          selectStartDate.add(Calendar.MONTH, i * 2);
          selectStopDate.add(Calendar.MONTH, (i * 2) + 2);
          selectStopDate.add(Calendar.DATE, -1);
          sd = new SimpleDateFormat("yyyy.MMM");
          periodDescription = sd.format(selectStartDate.getTime());
          break;
        case PERIOD_QUARTER:
          selectStartDate.add(Calendar.MONTH, i * 3);
          selectStopDate.add(Calendar.MONTH, (i * 3) + 3);
          selectStopDate.add(Calendar.DATE, -1);
          sd = new SimpleDateFormat("yyyy.MMM");
          periodDescription = sd.format(selectStartDate.getTime());
          break;
        case PERIOD_HALFYEAR:
          selectStartDate.add(Calendar.MONTH, i * 6);
          selectStopDate.add(Calendar.MONTH, (i * 6) + 6);
          selectStopDate.add(Calendar.DATE, -1);
          sd = new SimpleDateFormat("yyyy.MMM");
          periodDescription = sd.format(selectStartDate.getTime());
          break;
        case PERIOD_YEAR:
          selectStartDate.add(Calendar.YEAR, i);
          selectStopDate.add(Calendar.YEAR, i + 1);
          selectStopDate.add(Calendar.DATE, -1);
          sd = new SimpleDateFormat("yyyy");
          periodDescription = sd.format(selectStartDate.getTime());
          break;
        case PERIOD_ALL:
          java.sql.Date startDate = GetEarliestDate(CompId);
          selectStartDate.setTime(startDate);
          java.sql.Date stopDate = GetLatestDate(CompId);
          selectStopDate.setTime(stopDate);
          periodDescription = DateField.ConvertDateToLocalizedString(selectStartDate.getTime())
               + "<->" + DateField.ConvertDateToLocalizedString(selectStopDate.getTime());
          break;
        case PERIOD_GIVEN:
          selectStartDate.setTime(periodStart);
          selectStopDate.setTime(periodStop);
          periodDescription = DateField.ConvertDateToLocalizedString(selectStartDate.getTime())
               + "<->" + DateField.ConvertDateToLocalizedString(selectStopDate.getTime());
          break;
      }
      try {
        java.sql.Date start = new java.sql.Date(selectStartDate.getTime().getTime());
        java.sql.Date stop = new java.sql.Date(selectStopDate.getTime().getTime());

        PreparedStatement st = dc.con.prepareStatement(dc.filterSQL(getSelectStatement(CompId, useCustomer)));
        st.setDate(1, start);
        st.setDate(2, stop);
        ResultSet rs = st.executeQuery();

        int numRows = 0;
View Full Code Here

Examples of nu.lazy8.ledger.jdbc.DataConnection

   */
  public final static java.sql.Date GetEarliestDate(int CompId) {
    java.sql.Date returnDate =
        new java.sql.Date(Calendar.getInstance().getTime().getTime());
    try {
      DataConnection dc = DataConnection.getInstance(null);
      if (dc == null || !dc.bIsConnectionMade) {
        return new java.sql.Date(Calendar.getInstance().getTime().getTime());
      }
      Statement st = dc.con.createStatement();
      ResultSet rss = st.executeQuery(dc.filterSQL("SELECT MIN(Activity2.InvDate) FROM Activity2 WHERE CompId=" + CompId));
      if (rss.next()) {
        returnDate = rss.getDate(1);
      }
      rss.close();
    } catch (Exception e) {}
View Full Code Here

Examples of nu.lazy8.ledger.jdbc.DataConnection

   */
  public final static java.sql.Date GetLatestDate(int CompId) {
    java.sql.Date returnDate =
        new java.sql.Date(Calendar.getInstance().getTime().getTime());
    try {
      DataConnection dc = DataConnection.getInstance(null);
      if (dc == null || !dc.bIsConnectionMade) {
        return new java.sql.Date(Calendar.getInstance().getTime().getTime());
      }
      Statement st = dc.con.createStatement();
      ResultSet rss = st.executeQuery(dc.filterSQL("SELECT MAX(Activity2.InvDate) FROM Activity2 WHERE CompId=" + CompId));
      if (rss.next()) {
        returnDate = rss.getDate(1);
      }
      rss.close();
    } catch (Exception e) {}
View Full Code Here

Examples of nu.lazy8.ledger.jdbc.DataConnection

   *
   * @return    Description of the Return Value
   */
  public boolean IsDeleteOK() {
    try {
      DataConnection dc = DataConnection.getInstance(view);
      if (dc == null || !dc.bIsConnectionMade) {
        return false;
      }
      PreparedStatement stmt = dc.con.prepareStatement(dc.filterSQL(
          "SELECT * FROM APP.Account where CompId=? and IsAsset=?"));
      stmt.setInt(1, ((Integer) cc.comboBox.getSelectedItemsKey()).intValue());
      stmt.setInt(2, textField1.getInteger().intValue());
      ResultSet rs = stmt.executeQuery();
      if (rs.next()) {
View Full Code Here

Examples of nu.lazy8.ledger.jdbc.DataConnection

   * @param  viewStatic        Description of the Parameter
   * @param  deleteCompanyDef  Description of the Parameter
   */
  public static void RemoveCompanyFromDatabase(int companyId, JFrame viewStatic, boolean deleteCompanyDef) {
    try {
      DataConnection dcc = DataConnection.getInstance(viewStatic);
      if (dcc == null || !dcc.bIsConnectionMade) {
        return;
      }
      Statement st = dcc.con.createStatement();
      st.executeUpdate(dcc.filterSQL("DELETE FROM Activity2 WHERE CompId=" + companyId));
      st = dcc.con.createStatement();
      st.executeUpdate(dcc.filterSQL("DELETE FROM Amount WHERE CompId=" + companyId));
      st = dcc.con.createStatement();
      st.executeUpdate(dcc.filterSQL("DELETE FROM APP.Account WHERE CompId=" + companyId));
      st = dcc.con.createStatement();
      st.executeUpdate(dcc.filterSQL("DELETE FROM Customer2 WHERE CompId=" + companyId));
      st = dcc.con.createStatement();
      st.executeUpdate(dcc.filterSQL("DELETE FROM UniqNum WHERE CompId=" + companyId));
      st = dcc.con.createStatement();
      st.executeUpdate(dcc.filterSQL("DELETE FROM AccountingPeriods WHERE CompId=" + companyId));
      st = dcc.con.createStatement();
      st.executeUpdate(dcc.filterSQL("DELETE FROM AccountType WHERE CompId=" + companyId));
      if (deleteCompanyDef) {
        st = dcc.con.createStatement();
        st.executeUpdate(dcc.filterSQL("DELETE FROM Company WHERE CompId=" + companyId));
      }
      EditBus.send(new CompanyListChanged(null, "no parameters"));
    } catch (Exception e) {
      Log.log(Log.DEBUG, null, "Error in RemoveCompanyFromDatabase= " + e);
    }
View Full Code Here

Examples of nu.lazy8.ledger.jdbc.DataConnection

  //{{{ +showFirstScreen() : void
  /**
   *  Description of the Method
   */
  public void showFirstScreen() {
    DataConnection dc = DataConnection.getInstance(frameParent);
    if (dc == null || !dc.bIsConnectionMade) {
      setVisible(false);
      return;
    }

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.