Package com.knowgate.jdc

Examples of com.knowgate.jdc.JDCConnection


  oDao.destroy();

  oDao = new DAO();
    oDao.init(oMan.getConnectionProperties());

    JDCConnection oCon = DAO.getConnection("ModelManager");
    createCache(oCon);
    oCon.close("ModelManager");

  AtrilSession oSes = DAO.getAdminSession("ModelManager");

  createDeposits(oSes)
  oSes.commit();
View Full Code Here


  public void addSidesToTicket(AtrilSession oSes)
    throws DmsException {
   
    Log.out.debug("Begin DepositToZespedBridge.addSidesToTicket("+String.valueOf(lDepositId)+","+String.valueOf(lBillableId)+")");
    ArrayList<Document> aSides = new ArrayList<Document>();
    JDCConnection oCon = null;
    PreparedStatement oStm = null;
    try {
      oCon = DAO.getConnection("DepositToZespedBridge");
      oCon.setAutoCommit(false);
      oStm = oCon.prepareStatement("UPDATE Documento SET fkIdDocPadre=? WHERE IdDoc=?");
      Dms oDms = oSes.getDms();
      Document oDepo = oDms.getDocument(String.valueOf(lDepositId));
      Document oDdoc = oDepo.children().get(0);
      Document oBble = oDms.getDocument(String.valueOf(lBillableId))

      Log.out.debug("getting sides for document "+oDdoc.id());
           
      for (Document oSide : oDdoc.children()) {
        oStm.setLong(1, Long.parseLong(oBble.id()));
        oStm.setLong(2, Long.parseLong(oSide.id()));
        Log.out.debug("UPDATE documento SET fkIdDocPadre="+oBble.id()+" WHERE IdDoc="+oSide.id());
        oStm.executeUpdate();
        aSides.add(oSide);
        ThumbnailCreator.createThumbnailFor(oBble.id(), oSide.id());
      }
      oStm.close();
      oStm=null;
      oCon.commit();
      oCon.close();
      oCon=null;

    } catch (SQLException sqle) {
      Log.out.debug("SQLException "+sqle.getMessage());
      throw new DmsException(sqle.getMessage(), sqle);
    } finally {
      try {
        if (oCon!=null) {
          if (!oCon.isClosed()) {
            if (oStm!=null) oStm.close();
            oCon.rollback();
            oCon.close("DepositToZespedBridge");
          }
        }
      } catch (SQLException ignore) { Log.out.debug("SQLException "+ignore.getMessage()); }
    }
   
View Full Code Here

  public ArrayList<Document> addDocumentsToInvoices(AtrilSession oSes)
      throws DmsException {
     
      Log.out.debug("Begin DepositToZespedBridge.addSidesToInvoices("+String.valueOf(lDepositId)+")");
      ArrayList<Document> aSides = new ArrayList<Document>();
      JDCConnection oCon = null;
      PreparedStatement oStm = null;
      try {
        oCon = DAO.getConnection("DepositToZespedBridge");
        oCon.setAutoCommit(false);
        oStm = oCon.prepareStatement("UPDATE Documento SET fkIdDocPadre=? WHERE IdDoc=?");
        Dms oDms = oSes.getDms();
        TaxPayer txpy = new TaxPayer(oDms, sTaxPayerId);
        Invoices invs = txpy.invoices(oSes);
        Document oDepo = oDms.getDocument(String.valueOf(lDepositId));
        for (Document oDdoc : oDepo.children()) {
          Log.out.debug("getting sides for document "+oDdoc.id());
          NodeList<Document> oChlds = oDdoc.children();
          Invoice[] aInvs = invs.create(oSes, sUid, sFlavor, sTaxPayerId, sBiller, sRecipient, oChlds.size());
          int i = 0;
          for (Document oSide : oChlds) {
            Invoice oInvc = aInvs[i++];
            oStm.setLong(1, Long.parseLong(oInvc.id()));
            oStm.setLong(2, Long.parseLong(oSide.id()));
            Log.out.debug("UPDATE documento SET fkIdDocPadre="+oInvc.id()+" WHERE IdDoc="+oSide.id());
            oStm.executeUpdate();
            aSides.add(oSide);
            ThumbnailCreator.createThumbnailFor(oInvc.id(), oSide.id());
          }
          oCon.commit();
        }
        oStm.close();
        oStm=null;
        oCon.close();
        oCon=null;
       
      } catch (SQLException sqle) {
        Log.out.debug("SQLException "+sqle.getMessage());
        throw new DmsException(sqle.getMessage(), sqle);
      } finally {
        try {
          if (oCon!=null) {
            if (!oCon.isClosed()) {
              if (oStm!=null) oStm.close();
              oCon.rollback();
              oCon.close("DepositToZespedBridge");
            }
          }
        } catch (SQLException ignore) { Log.out.debug("SQLException "+ignore.getMessage()); }
      }
     
View Full Code Here

  // --------------------------------------------------------------------------
 
  public static String getRepositoryVersion() throws SQLException {
    if (!bInitOK) throw new IllegalStateException("DAO was not properly initialized");
    JDCConnection oCon = oRdbms.getConnection("DAO.getRepositoryVersion");
    String sVersion;
    if (DBBind.exists(oCon, "VersionRepositorio", "U")) {
      sVersion = DBCommand.queryStr(oCon, "SELECT IdVersion FROM VersionRepositorio");
    } else {
      sVersion = null;
    }
    oCon.close("DAO.getRepositoryVersion");
    return sVersion;
  }
View Full Code Here

TOP

Related Classes of com.knowgate.jdc.JDCConnection

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.