Package nu.lazy8.ledger.jdbc

Examples of nu.lazy8.ledger.jdbc.DataConnection.filterSQL()


    try {
      DataConnection dc = DataConnection.getInstance(view);
      if (dc == null || !dc.bIsConnectionMade) {
        return false;
      }
      PreparedStatement stmt = dc.con.prepareStatement(dc.filterSQL(
          "SELECT * FROM Amount where CompId=? and Customer=?"));
      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


    try {
      DataConnection dc = DataConnection.getInstance(view);
      if (dc == null || !dc.bIsConnectionMade) {
        return false;
      }
      PreparedStatement stmt = dc.con.prepareStatement(dc.filterSQL(
          "SELECT * FROM Customer2 where CompId=? and CustId=?"));
      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

      DataConnection dc = DataConnection.getInstance(null);
      if (dc == null || !dc.bIsConnectionMade) {
        return;
      }
      Statement st = dc.con.createStatement();
      ResultSet rs = st.executeQuery(dc.filterSQL(
          "SELECT MAX(CustId) FROM Customer2 WHERE CompId=" + ((Integer) cc.comboBox.getSelectedItemsKey()).intValue()));
      if (rs.next()) {
        int highestId = rs.getInt(1);
        highestId++;
        textField1.setInteger(new Integer(highestId));
View Full Code Here

      DataConnection dc = DataConnection.getInstance(null);
      if (dc == null || !dc.bIsConnectionMade) {
        return 0;
      }
      Statement stmt = dc.con.createStatement();
      ResultSet rs = stmt.executeQuery(dc.filterSQL("SELECT DefaultAcc FROM Customer2 where CompId=" + iCompId + " and CustId=" + iCustId));
      if (rs.next()) {
        return rs.getInt(1);
      }
      return 0;
    } catch (Exception ex) {
View Full Code Here

          Lazy8LedgerPlugin.createRestoreFile(dc.con, true, ff.getAbsolutePath(), iCompId, frameParent);
          //name was destroyed in the last operation
          CompanyForm.quickAndDirtyChangeCompany(iCompId, sCompName);
          //period destroyed also...
          try {
            PreparedStatement stmt = dc.con.prepareStatement(dc.filterSQL(
                "INSERT INTO AccountingPeriods (CompId,StartPeriod,EndPeriod) VALUES(?,?,?)"));
            stmt.setInt(1, iCompId);
            stmt.setDate(2, new java.sql.Date(dateField1.getDate().getTime()));
            stmt.setDate(3, new java.sql.Date(dateField2.getDate().getTime()));
            stmt.executeUpdate();
View Full Code Here

                try {
                  DataConnection dc = DataConnection.getInstance(null);
                  if (dc == null || !dc.bIsConnectionMade) {
                    return;
                  }
                  PreparedStatement stmt = dc.con.prepareStatement(dc.filterSQL(
                      "INSERT INTO AccountingPeriods (CompId,StartPeriod,EndPeriod) VALUES(?,?,?)"));
                  stmt.setInt(1, iCompId);
                  stmt.setDate(2, new java.sql.Date(dateField1.getDate().getTime()));
                  stmt.setDate(3, new java.sql.Date(dateField2.getDate().getTime()));
                  stmt.executeUpdate();
View Full Code Here

        Statement st = dc.con.createStatement();
        String select = "SELECT APP.Account.Account,AccDesc,TypeName,IsInBalanceReport " +
            "FROM APP.Account,AccountType WHERE AccountType.AccTypeId=APP.Account.IsAsset " +
            "AND AccountType.CompId=APP.Account.CompId AND AccountType.CompId=" +
            CompId + " ORDER BY APP.Account.Account";
        ResultSet rs = st.executeQuery(dc.filterSQL(select));
        numRows = 0;
        while (rs.next()) {
          numRows++;
        }
        rs.beforeFirst();
View Full Code Here

      DataConnection dc = DataConnection.getInstance(view);
      if (dc == null || !dc.bIsConnectionMade) {
        return;
      }
      Statement st = dc.con.createStatement();
      ResultSet rs = st.executeQuery(dc.filterSQL(sSelectString));
      ResultSetMetaData rsmd = rs.getMetaData();
      if (rsmd == null) {
        return;
      }
      int iNumColumns = rsmd.getColumnCount();
View Full Code Here

      executeUpdate(group[0], saveFields, tableActivityIndexes,
          CompId, rowCount - group.length, "Activity2", sqlConnect, DataTypes, formatNumPane, resultMessage);
      try {
        DataConnection dc = DataConnection.getInstance(view);
        Statement st = dc.con.createStatement();
        st.executeUpdate(dc.filterSQL("DELETE FROM UniqNum WHERE CompId=" + CompId + " AND UniqName='Act_Id'"));
        st = dc.con.createStatement();
        st.executeUpdate(dc.filterSQL(
            "INSERT INTO UniqNum (CompId,UniqName,LastNumber) VALUES (" +
            CompId + ",'Act_Id'," + act_id + ")"));
      } catch (Exception e) {
View Full Code Here

      try {
        DataConnection dc = DataConnection.getInstance(view);
        Statement st = dc.con.createStatement();
        st.executeUpdate(dc.filterSQL("DELETE FROM UniqNum WHERE CompId=" + CompId + " AND UniqName='Act_Id'"));
        st = dc.con.createStatement();
        st.executeUpdate(dc.filterSQL(
            "INSERT INTO UniqNum (CompId,UniqName,LastNumber) VALUES (" +
            CompId + ",'Act_Id'," + act_id + ")"));
      } catch (Exception e) {
        resultMessage.append("Failed to update the UniqNum table with the value act_id=" + act_id + "\n");
        Log.log(Log.ERROR, this, "Failed to update the UniqNum table with the value act_id=" + act_id);
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.