Package com.knowgate.jdc

Examples of com.knowgate.jdc.JDCConnection.prepareStatement()


          if (DebugFile.trace) DebugFile.writeln("Already finished jobs "+String.valueOf(oFinished.size()));

          if (oFinished.size()>0) {
            sSQL = "UPDATE k_jobs SET id_status="+String.valueOf(Job.STATUS_FINISHED)+",dt_finished="+DBBind.Functions.GETDATE+" WHERE gu_job=?";
            if (DebugFile.trace) DebugFile.writeln("Connection.prepareStatement("+sSQL+") on connection with process id. "+oJcn.pid());
            PreparedStatement oUpdt = oJcn.prepareStatement(sSQL);
            oIter = oFinished.listIterator();
            while (oIter.hasNext()) {
              oUpdt.setObject(1, oIter.next(), java.sql.Types.CHAR);
              oUpdt.executeUpdate();
            } // wend
View Full Code Here


        File[] aDirs = oBase.listFiles();
        if (aDirs!=null) {
          DBBind oDbbd = new DBBind(argv[0]);
          Contact oCont = new Contact();
          JDCConnection oConn = oDbbd.getConnection("AttachmentUploader");
          PreparedStatement oStmt = oConn.prepareStatement("SELECT "+DB.gu_contact+","+DB.gu_workarea+" FROM "+DB.k_contacts+" WHERE "+DB.gu_contact+"=? OR "+DB.id_ref+"=? OR "+DB.sn_passport+"=?",
                                                           ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
          oConn.setAutoCommit(false);
          int nDirs = aDirs.length;
          for (int d=0; d<nDirs; d++) {
            if (aDirs[d].isDirectory()) {
View Full Code Here

    if (DebugFile.trace) {
      DebugFile.writeln("Creating message "+sGuMsg+" "+sIdMsg+" at folder "+oDraftsFldr.getName()+" "+sGuFldr);
      DebugFile.writeln("JDCConnection.prepareStatement(SELECT MAX("+DB.pg_message+") FROM "+DB.k_mime_msgs+" WHERE "+DB.gu_category+"='"+sGuFldr+"')");
    }

    oStmt = oConn.prepareStatement("SELECT MAX("+DB.pg_message+") FROM "+DB.k_mime_msgs+" WHERE "+DB.gu_category+"=?");
    oStmt.setString (1,sGuFldr);
    oRSet = oStmt.executeQuery();
    oRSet.next();
    java.math.BigDecimal oMax = oRSet.getBigDecimal(1);
    if (oRSet.wasNull()) oMax = new java.math.BigDecimal(0);
View Full Code Here

    if (DebugFile.trace) {
      DebugFile.writeln("JDCConnection.prepareStatement(INSERT INTO "+DB.k_mime_msgs+" ("+DB.gu_mimemsg+","+DB.pg_message+","+DB.gu_workarea+","+DB.gu_category+","+DB.id_type+","+DB.id_message+","+DB.tx_subject+","+DB.tx_email_from+","+DB.tx_email_reply+","+DB.nm_from+","+DB.len_mimemsg+","+DB.bo_draft+","+DB.bo_deleted+") VALUES('"+sGuMsg+"',"+oMax.add(new java.math.BigDecimal(1)).toString()+",'"+sGuWorkArea+"','"+sGuFldr+"','text/"+sContentType+"; charset=utf-8','"+sIdMsg+"','','"+oUsr.getString(DB.tx_main_email)+"','"+oUsr.getString(DB.tx_main_email)+"','"+sFrom.trim()+"',0,1,0))");
    }

    oStmt = oConn.prepareStatement("INSERT INTO "+DB.k_mime_msgs+" ("+DB.gu_mimemsg+","+DB.pg_message+","+DB.gu_workarea+","+DB.gu_category+","+DB.id_type+","+DB.id_message+","+DB.tx_subject+","+DB.tx_email_from+","+DB.tx_email_reply+","+DB.nm_from+","+DB.len_mimemsg+","+DB.bo_draft+","+DB.bo_deleted+") VALUES(?,?,?,?,?,?,?,?,?,?,0,1,0)");
    oStmt.setString (1,sGuMsg);
    oStmt.setBigDecimal (2,oMax.add(new java.math.BigDecimal(1)));
    oStmt.setString (3,sGuWorkArea);
    oStmt.setString (4,sGuFldr);
    oStmt.setString (5,"text/"+sContentType+"; charset=utf-8");
View Full Code Here

    if (DebugFile.trace) {
      DebugFile.writeln(String.valueOf(nAffected)+" affected rows");
    }   
       
    oStmt = oConn.prepareStatement("INSERT INTO "+DB.k_inet_addrs+" ("+DB.gu_mimemsg+","+DB.id_message+","+DB.tx_email+","+DB.tp_recipient+","+DB.tx_personal+","+DB.gu_user+") VALUES (?,?,?,?,?,?)");
    oStmt.setString (1,sGuMsg);
    oStmt.setString (2,sIdMsg);
    oStmt.setString (3,oUsr.getString(DB.tx_main_email));
    oStmt.setString (4,"from");
    oStmt.setString (5,sFrom.trim());
View Full Code Here

    MimeBodyPart oText = new MimeBodyPart();
    oText.setContent(sText, "text/html");
    java.io.ByteArrayOutputStream oBaStrm = new java.io.ByteArrayOutputStream(sText.length()*2+2);
    oText.writeTo(oBaStrm);

    oStmt = oConn.prepareStatement("UPDATE "+DB.k_mime_msgs+" SET "+DB.len_mimemsg+"=?"+","+DB.tx_subject+"=?,"+DB.by_content+"=? WHERE "+DB.gu_mimemsg+"=?");
    oStmt.setInt(1, oBaStrm.size());
    oStmt.setString(2, oOrMsg.getSubject());
    oStmt.setBinaryStream(3, new java.io.ByteArrayInputStream(oBaStrm.toByteArray()), oBaStrm.size());
    oStmt.setString(4, oDraft.getMessageGuid());
    oStmt.executeUpdate();
View Full Code Here

  sSQL = "INSERT INTO "+DB.k_inet_addrs+" ("+DB.gu_mimemsg+","+DB.id_message+","+DB.tx_email+","+DB.tp_recipient+","+DB.tx_personal+","+DB.gu_user+","+DB.gu_contact+","+DB.gu_company+") (SELECT '"+oDraft.getMessageGuid()+"','"+sIdMsg+"',"+DB.tx_email+",'to',"+DB.tx_personal+","+DB.gu_user+","+DB.gu_contact+","+DB.gu_company+" FROM "+DB.k_inet_addrs+" WHERE "+DB.gu_mimemsg+"=? AND "+DB.tp_recipient+"='from')";

    if (DebugFile.trace) DebugFile.writeln("JDCConnection.prepareStatement("+sSQL+")");

    oStmt = oConn.prepareStatement(sSQL);
    oStmt.setString (1, sGuOriginalMsg );
    oStmt.executeUpdate();
    oStmt.close();
   
    if (oFrom!=null) {
View Full Code Here

    }

    if (bReplyAll) {
      sSQL = "INSERT INTO "+DB.k_inet_addrs+" ("+DB.gu_mimemsg+","+DB.id_message+","+DB.tx_email+","+DB.tp_recipient+","+DB.tx_personal+","+DB.gu_user+","+DB.gu_contact+","+DB.gu_company+") (SELECT '"+oDraft.getMessageGuid()+"','"+sIdMsg+"',"+DB.tx_email+",'to',"+DB.tx_personal+","+DB.gu_user+","+DB.gu_contact+","+DB.gu_company+" FROM "+DB.k_inet_addrs+" WHERE "+DB.gu_mimemsg+"=? AND "+DB.tp_recipient+"='to')";
      if (DebugFile.trace) DebugFile.writeln("JDCConnection.prepareStatement("+sSQL+")");
      oStmt = oConn.prepareStatement(sSQL);
      oStmt.setString (1,sGuOriginalMsg);
      oStmt.executeUpdate();
      oStmt.close();

      oDraft.addRecipients(RecipientType.TO, oOrMsg.getRecipients(RecipientType.TO));
View Full Code Here

      oDraft.addRecipients(RecipientType.TO, oOrMsg.getRecipients(RecipientType.TO));

    sSQL = "INSERT INTO "+DB.k_inet_addrs+" ("+DB.gu_mimemsg+","+DB.id_message+","+DB.tx_email+","+DB.tp_recipient+","+DB.tx_personal+","+DB.gu_user+","+DB.gu_contact+","+DB.gu_company+") (SELECT '"+oDraft.getMessageGuid()+"','"+sIdMsg+"',"+DB.tx_email+",'cc',"+DB.tx_personal+","+DB.gu_user+","+DB.gu_contact+","+DB.gu_company+" FROM "+DB.k_inet_addrs+" WHERE "+DB.gu_mimemsg+"=? AND "+DB.tp_recipient+"='cc')";
      if (DebugFile.trace) DebugFile.writeln("JDCConnection.prepareStatement("+sSQL+")");
      oStmt = oConn.prepareStatement(sSQL);
      oStmt.setString (1,sGuOriginalMsg);
      oStmt.executeUpdate();
      oStmt.close();

      oDraft.addRecipients(RecipientType.CC, oOrMsg.getRecipients(RecipientType.CC));
View Full Code Here

    oText.setContent(sText, "text/html");
    java.io.ByteArrayOutputStream oBaStrm = new java.io.ByteArrayOutputStream(sText.length()*2+2);
    oText.writeTo(oBaStrm);

    java.math.BigDecimal oPosition;
    oStmt = oConn.prepareStatement("SELECT "+DB.nu_position+" FROM "+DB.k_mime_msgs+" WHERE "+DB.gu_mimemsg+"=?");
    oStmt.setString(1, sGuOriginalMsg);
    oRSet = oStmt.executeQuery();
    if (oRSet.next())
      oPosition = oRSet.getBigDecimal(1);
    else
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.