??xml version="1.0" encoding="utf-8" standalone="yes"?>91精品亚洲,久久久久亚洲精品国产,欧美精品一区二区三http://www.aygfsteel.com/zolly/  Focus on BPM, celebrate PegaRULES Process Commander (PRPC)zh-cnSat, 03 May 2025 08:22:34 GMTSat, 03 May 2025 08:22:34 GMT60"No suitable driver found" error when connecting to different database with Pega rule basehttp://www.aygfsteel.com/zolly/archive/2014/06/03/No_suitable_driver_found.htmlzollyzollyMon, 02 Jun 2014 18:15:00 GMThttp://www.aygfsteel.com/zolly/archive/2014/06/03/No_suitable_driver_found.htmlhttp://www.aygfsteel.com/zolly/comments/414326.htmlhttp://www.aygfsteel.com/zolly/archive/2014/06/03/No_suitable_driver_found.html#Feedback1http://www.aygfsteel.com/zolly/comments/commentRss/414326.htmlhttp://www.aygfsteel.com/zolly/services/trackbacks/414326.htmlGo into SMA -> Advanced -> Etier Runtime Environment
For Java class name (e.g.: com.microsoft.sqlserver.jdbc.SQLServerDriver) click on the Lookup Java Class button and confirm that the Java class is being found in the lib directory where you have put the jar file. 
If the class is not found there please confirm that you restarted the app server after adding the jar file to the lib directory.
If the class is found in the lib directory like it should be please go back to the Database rule and try the test connection again and this time it should work.


zolly 2014-06-03 02:15 发表评论
]]>
SpringFramework 4 + Hibernate 4 + Maven 实例http://www.aygfsteel.com/zolly/archive/2014/04/01/SpringFramework4_Hibernate4_Maven.htmlzollyzollyTue, 01 Apr 2014 00:40:00 GMThttp://www.aygfsteel.com/zolly/archive/2014/04/01/SpringFramework4_Hibernate4_Maven.htmlhttp://www.aygfsteel.com/zolly/comments/411766.htmlhttp://www.aygfsteel.com/zolly/archive/2014/04/01/SpringFramework4_Hibernate4_Maven.html#Feedback0http://www.aygfsteel.com/zolly/comments/commentRss/411766.htmlhttp://www.aygfsteel.com/zolly/services/trackbacks/411766.htmlClientLogging.zip
2. Ҏ(gu)工程文g中的SQL文gdb-mssql.sql创徏数据库表?br />3. Ҏ(gu)需要修改db-mssql.properties
4. 执行Maven Install生成war包,部v到Tomcat。或者在Eclipse中部|Tomcat Serverq行?br />5. 讉Khttp://localhost:8080/RequestLogging/loggings

zolly 2014-04-01 08:40 发表评论
]]>
JavadOracle BLOB字段CZhttp://www.aygfsteel.com/zolly/archive/2013/05/28/CopyOracleBLOB.htmlzollyzollyTue, 28 May 2013 05:33:00 GMThttp://www.aygfsteel.com/zolly/archive/2013/05/28/CopyOracleBLOB.htmlhttp://www.aygfsteel.com/zolly/comments/399864.htmlhttp://www.aygfsteel.com/zolly/archive/2013/05/28/CopyOracleBLOB.html#Feedback1http://www.aygfsteel.com/zolly/comments/commentRss/399864.htmlhttp://www.aygfsteel.com/zolly/services/trackbacks/399864.html
EXP导出CZQ?br />
exp name/password@orcl file=E:/exp.dump log=E:/exp.log table=(tb_emp) query="""where UserName='FN'"""

EXPDP导出CZQ?br />Sample.bat
expdp name/password@orcl parfile=E:/expdp.par
expdp.par
DIRECTORY=dir_dump
DUMPFILE=backup.dump
LOGFILE=backup.log
TABLES=pr_data_admin
QUERY=pr_data_admin:"where UserName='FN'"

以上Ҏ(gu)因ؓ(f)我电(sh)脑上的Oracle版本对不上,L报错Q后来采用java的方法,本文主要介绍如何使用javadOracle的BLOB字段Q达到复制{UBLOB数据的目的。代码如下,加入ojdbc.jarQ复制代码可以直接运行:(x)
DBConnection.java
package com.zolly.blob;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBConnection {

    public static Connection getDBConnectionFrom() throws Exception {
        Connection con = null;
        String driver = "oracle.jdbc.driver.OracleDriver";// database driver
        String url = "jdbc:oracle:thin:@192.168.1.2:1545:ORCL";// database URL
        String user = "user1"; // database name
        String password = "password1"; // database Password
        Class.forName(driver);
        con = DriverManager.getConnection(url, user, password);
        return con;
    }
    
    public static Connection getDBConnectionTo() throws Exception {
        Connection con = null;
        String driver = "oracle.jdbc.driver.OracleDriver";// database driver
        String url = "jdbc:oracle:thin:@192.168.1.3:1521:ORCL";// database URL
        String user = "user2"; // database name
        String password = "password2"; // database Password
        Class.forName(driver);
        con = DriverManager.getConnection(url, user, password);
        return con;
    }

}

BLOBUtil.java
package com.zolly.blob;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

import oracle.sql.BLOB;

public class BLOBUtil {
    @SuppressWarnings("deprecation")
    public static void writeBLOB() {
        Connection con = null;
        long start = System.currentTimeMillis(); // count runtime
        InputStream fin = null;
        OutputStream outStream = null;
        String path = "E:\\requestor.txt";
        File file = new File(path);
        try {
            con = DBConnection.getDBConnectionTo();
            con.setAutoCommit(false);

            Statement stmt = con.createStatement();
            ResultSet rs = stmt
                    .executeQuery("select pzPVStream from pr_data_admin where pxInsName='PEGA!BROWSER' for update");
            // get specially columns and rows for update
            while (rs.next()) {
                // System.out.print(rs.getInt(1)+rs.getString(2)+"\n");//print
                
// select sql for debug
                BLOB blob = (BLOB) rs.getBlob("pzPVStream");
                outStream = blob.getBinaryOutputStream();
                fin = new FileInputStream(file); // put file into stream
                byte[] b = new byte[blob.getBufferSize()];
                int len = 0;
                while ((len = fin.read(b)) != -1) {
                    outStream.write(b, 0, len);
                }

                fin.close();
                outStream.flush();
                outStream.close();
            }
            System.out.print("\nupdate ok\n");

            con.commit();

            con.close();
        }

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

        long end = System.currentTimeMillis();
        System.out.println(end - start);
    }

    public static void readBLOB() {
        Connection con = null;
        long start = System.currentTimeMillis(); // count runtime
        String path = "E:\\requestor.txt";
        File file = new File(path);
        try {
            con = DBConnection.getDBConnectionFrom();
            con.setAutoCommit(false);
            Statement stmt = con.createStatement();
            ResultSet rs = stmt
                    .executeQuery("select pzPVStream from pr_data_admin where pxInsName='PEGA!BROWSER'");
            // get blob form your table
            if (rs.next()) {
                BLOB blob = (BLOB) rs.getBlob("pzPVStream");
                // get word column
                FileOutputStream output = new FileOutputStream(file);
                // define a file output stream
                InputStream input = blob.getBinaryStream();// put blob into
                                                            
// input
                byte[] buffer = new byte[blob.getBufferSize()];
                // if use 1024 it will lose some bytes
                int len = 0;
                while ((len = input.read(buffer)) != -1) {
                    // get all input stream into output file stream
                    output.write(buffer, 0, len);
                    input.close();
                    output.flush();
                    output.close();
                }
                System.out.print("\ndownload ok\n");
            }
            con.close();
        } catch (Exception e) {
            e.printStackTrace();
        }

        long end = System.currentTimeMillis();
        System.out.println(end - start);

    }

    public static void main(String[] args) {
        BLOBUtil.readBLOB();
        BLOBUtil.writeBLOB();
    }

}


zolly 2013-05-28 13:33 发表评论
]]>
ZJava API的DESede(Triple-DES)加密解密CZhttp://www.aygfsteel.com/zolly/archive/2013/05/25/DESede_Encryption.htmlzollyzollyFri, 24 May 2013 17:50:00 GMThttp://www.aygfsteel.com/zolly/archive/2013/05/25/DESede_Encryption.htmlhttp://www.aygfsteel.com/zolly/comments/399685.htmlhttp://www.aygfsteel.com/zolly/archive/2013/05/25/DESede_Encryption.html#Feedback0http://www.aygfsteel.com/zolly/comments/commentRss/399685.htmlhttp://www.aygfsteel.com/zolly/services/trackbacks/399685.html
Bouncy Castle也支持DES法Q具体没有深入研IӞ有兴的可以下蝲相应的APIq行试?br />http://www.bouncycastle.org/

以下代码基本上覆盖了生成密钥以及加密解密的全q程Q拷贝代码可以直接运行?代码摘自|络)
每次生成密钥都会(x)不一P一般来说密钥需要生成文件ƈ妥善保存?br />
DESedeCoder.java
package com.zolly.bouncycastle;

import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.security.Key;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESedeKeySpec;

import com.sun.org.apache.xml.internal.security.utils.Base64;

/**
 * DESede对称加密法演示
 * 
 * 
@author zolly
 * 
*/
public class DESedeCoder {
    /**
     * 密钥法
     * 
*/
    public static final String KEY_ALGORITHM = "DESede";

    /**
     * 加密/解密法/工作模式/填充方式
     * 
*/
    public static final String CIPHER_ALGORITHM = "DESede/ECB/PKCS5Padding";

    /**
     * 
     * 生成密钥
     * 
     * 
@return byte[] 二进制密?br />     * */
    public static byte[] initkey() throws Exception {

        // 实例化密钥生成器
        KeyGenerator kg = KeyGenerator.getInstance(KEY_ALGORITHM);
        // 初始化密钥生成器
        kg.init(168);
        // 生成密钥
        SecretKey secretKey = kg.generateKey();
        // 获取二进制密钥编码Ş?/span>
        
        byte[] key = secretKey.getEncoded();
        BufferedOutputStream keystream = 
                new BufferedOutputStream(new FileOutputStream("DESedeKey.dat"));
        keystream.write(key, 0, key.length);
        keystream.flush();
        keystream.close();
        
        return key;
    }

    /**
     * 转换密钥
     * 
     * 
@param key
     *            二进制密?br />     * 
@return Key 密钥
     * 
*/
    public static Key toKey(byte[] key) throws Exception {
        // 实例化Des密钥
        DESedeKeySpec dks = new DESedeKeySpec(key);
        // 实例化密钥工?/span>
        SecretKeyFactory keyFactory = SecretKeyFactory
                .getInstance(KEY_ALGORITHM);
        // 生成密钥
        SecretKey secretKey = keyFactory.generateSecret(dks);
        return secretKey;
    }

    /**
     * 加密数据
     * 
     * 
@param data
     *            待加密数?br />     * 
@param key
     *            密钥
     * 
@return byte[] 加密后的数据
     * 
*/
    public static byte[] encrypt(byte[] data, byte[] key) throws Exception {
        // q原密钥
        Key k = toKey(key);
        // 实例?/span>
        Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
        // 初始化,讄为加密模?/span>
        cipher.init(Cipher.ENCRYPT_MODE, k);
        // 执行操作
        return cipher.doFinal(data);
    }

    /**
     * 解密数据
     * 
     * 
@param data
     *            待解密数?br />     * 
@param key
     *            密钥
     * 
@return byte[] 解密后的数据
     * 
*/
    public static byte[] decrypt(byte[] data, byte[] key) throws Exception {
        // Ƣ迎密钥
        Key k = toKey(key);
        // 实例?/span>
        Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
        // 初始化,讄密模?/span>
        cipher.init(Cipher.DECRYPT_MODE, k);
        // 执行操作
        return cipher.doFinal(data);
    }

    /**
     * q行加解密的试
     * 
     * 
@throws Exception
     
*/
    public static void main(String[] args) throws Exception {
        String str = "DESede";
        System.out.println("原文Q? + str);
        // 初始化密?/span>
        byte[] key = DESedeCoder.initkey();
        System.out.println("密钥Q? + Base64.encode(key));
        // 加密数据
        byte[] data = DESedeCoder.encrypt(str.getBytes(), key);
        System.out.println("加密后:(x)" + Base64.encode(data));
        // 解密数据
        data = DESedeCoder.decrypt(data, key);
        System.out.println("解密后:(x)" + new String(data));
    }
}


正对以上代码Q我q行了适当修改Q其变得更加实用。我的主要应用是把客L(fng)数据加密保存到数据库Q取出来的时候再解密Q保证数据库数据的安全。注意我固定了密钥,以防密钥一旦丢失,所有数据都变成q了,固定密钥安全性有所降低Q但是对数据库字D加密安全性已l够了?br />
DESedeTest.java
package com.zolly.bouncycastle;

import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;

import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESedeKeySpec;

import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException;
import com.sun.org.apache.xml.internal.security.utils.Base64;

public class DESedeTest {

    /**
     * 
@param args
     
*/
    public static void main(String[] args) {

        String strText = "This is a testing";

        String text1 = DESedeTest.encryptProperty(strText);

        String text2 = DESedeTest.decryptProperty(text1);

        System.out.println(text1);

        System.out.println(text2);
    }

    public static String encryptProperty(String clearText) {

        String KEY_STRING = "RRYa6li5NGFodgKUtvS1I6fZwY8xpJjI";

        byte[] key = null;

        try {
            key = Base64.decode(KEY_STRING);
        } catch (Base64DecodingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        return DESedeTest.performDESedeCoder(clearText, key, true);
    }

    public static String decryptProperty(String cipherText) {

        String KEY_STRING = "RRYa6li5NGFodgKUtvS1I6fZwY8xpJjI";

        byte[] key = null;

        try {
            key = Base64.decode(KEY_STRING);
        } catch (Base64DecodingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        return DESedeTest.performDESedeCoder(cipherText, key, false);
    }

    public static String performDESedeCoder(String inputValue, byte[] key,
            boolean encrypt) {
        String rtnValue = "";

        String KEY_ALGORITHM = "DESede";
        String CIPHER_ALGORITHM = "DESede/ECB/PKCS5Padding";

        byte[] data = null;
        try {
            DESedeKeySpec dks = new DESedeKeySpec(key);

            SecretKeyFactory keyFactory = SecretKeyFactory
                    .getInstance(KEY_ALGORITHM);

            SecretKey secretKey = keyFactory.generateSecret(dks);

            Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);

            byte[] input = null;
            if (encrypt) {
                cipher.init(Cipher.ENCRYPT_MODE, secretKey);
                input = inputValue.getBytes();
            } else {
                cipher.init(Cipher.DECRYPT_MODE, secretKey);
                input = Base64.decode(inputValue);
            }

            data = cipher.doFinal(input);
        } catch (InvalidKeyException e) {
            System.out.println(e.getMessage());
        } catch (NoSuchAlgorithmException e) {
            System.out.println(e.getMessage());
        } catch (InvalidKeySpecException e) {
            System.out.println(e.getMessage());
        } catch (NoSuchPaddingException e) {
            System.out.println(e.getMessage());
        } catch (IllegalBlockSizeException e) {
            System.out.println(e.getMessage());
        } catch (BadPaddingException e) {
            System.out.println(e.getMessage());
        } catch (Base64DecodingException e) {
            System.out.println(e.getMessage());
        }

        if (data == null) {
            rtnValue = inputValue;
        } else {
            if (encrypt) {
                rtnValue = com.sun.org.apache.xml.internal.security.utils.Base64
                        .encode(data);
            } else {
                rtnValue = new String(data);
            }
        }

        return rtnValue;
    }
}



zolly 2013-05-25 01:50 发表评论
]]>
ZJava Bouncy Castle的PGP加密解密CZhttp://www.aygfsteel.com/zolly/archive/2013/05/24/PGP_Encryption.htmlzollyzollyFri, 24 May 2013 00:37:00 GMThttp://www.aygfsteel.com/zolly/archive/2013/05/24/PGP_Encryption.htmlhttp://www.aygfsteel.com/zolly/comments/399684.htmlhttp://www.aygfsteel.com/zolly/archive/2013/05/24/PGP_Encryption.html#Feedback23http://www.aygfsteel.com/zolly/comments/commentRss/399684.htmlhttp://www.aygfsteel.com/zolly/services/trackbacks/399684.htmlPGP即Pretty Good PrivacyQ是一个基于RSA公钥&U钥及AES{非对称加密法的加密Y件系列,比较h代表性加密解密客L(fng)已被Symantec收购Q详见www.pgp.comQ在Symantec的网站上可以下蝲最新版客户端Y件?br />
本文讲的是用JavaZBouncy Castle包的PGP加密解密CZQ按照以下步骤即可轻村֮玎ͼ(x)

1. 客户端Y?br />׃Symantec的PGP客户端是收费软gQ本文只需要用其中的生成U钥和加密文件的功能Q用该Y件有些浪费,所以我下蝲了Java 免费版的Portable PGP(http://sourceforge.net/projects/ppgp/)

2. 下蝲Bouncy Castle?br />http://www.bouncycastle.org/latest_releases.html
bcprov-jdk15on-148.jar和bcpg-jdk15on-148.jar
Bouncy Castle支持大量的密码术法Q其中包括OpenPGPQ引用很q泛QPega是使用Bouncy Castle寚w件和客户重要数据q行加密解密的?br />它既可以安装成JDK扩展也可以放到特定java目中用?br />
3. 在Oracle官网下蝲UnlimitedJCEPolicy
http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
JDK默认Policy只能支持<=128位KeyQGPG的密钥从1024-2048Q所以必L展该Policy。具体安装方法参考文件中的ReadMe文g?/div>
4. ~写代码
使用Portable PGP加密文g后生成Public Key和Private Key。把试用Public Key加密的文?Encrypted File.txt"和Private Key "Key.asc"一同放到项目文件夹中?br />使用以下代码卛_解密文g?拯以下代码可以直接执行Q以下代码也是来自Bouncy Castle源代码包)

PGPExampleUtil.java
package com.zolly.bouncycastle;

import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.NoSuchProviderException;
import java.util.Iterator;

import org.bouncycastle.openpgp.PGPCompressedDataGenerator;
import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPLiteralData;
import org.bouncycastle.openpgp.PGPPrivateKey;
import org.bouncycastle.openpgp.PGPPublicKey;
import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
import org.bouncycastle.openpgp.PGPSecretKey;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
import org.bouncycastle.openpgp.PGPUtil;

class PGPExampleUtil
{
    static byte[] compressFile(String fileName, int algorithm) throws IOException
    {
        ByteArrayOutputStream bOut = new ByteArrayOutputStream();
        PGPCompressedDataGenerator comData = new PGPCompressedDataGenerator(algorithm);
        PGPUtil.writeFileToLiteralData(comData.open(bOut), PGPLiteralData.BINARY,
            new File(fileName));
        comData.close();
        return bOut.toByteArray();
    }

    /**
     * Search a secret key ring collection for a secret key corresponding to keyID if it
     * exists.
     * 
     * 
@param pgpSec a secret key ring collection.
     * 
@param keyID keyID we want.
     * 
@param pass passphrase to decrypt secret key with.
     * 
@return
     * 
@throws PGPException
     * 
@throws NoSuchProviderException
     
*/
    static PGPPrivateKey findSecretKey(PGPSecretKeyRingCollection pgpSec, long keyID, char[] pass)
        throws PGPException, NoSuchProviderException
    {
        PGPSecretKey pgpSecKey = pgpSec.getSecretKey(keyID);

        if (pgpSecKey == null)
        {
            return null;
        }

        return pgpSecKey.extractPrivateKey(pass, "BC");
    }

    static PGPPublicKey readPublicKey(String fileName) throws IOException, PGPException
    {
        InputStream keyIn = new BufferedInputStream(new FileInputStream(fileName));
        PGPPublicKey pubKey = readPublicKey(keyIn);
        keyIn.close();
        return pubKey;
    }

    /**
     * A simple routine that opens a key ring file and loads the first available key
     * suitable for encryption.
     * 
     * 
@param input
     * 
@return
     * 
@throws IOException
     * 
@throws PGPException
     
*/
    static PGPPublicKey readPublicKey(InputStream input) throws IOException, PGPException
    {
        PGPPublicKeyRingCollection pgpPub = new PGPPublicKeyRingCollection(
            PGPUtil.getDecoderStream(input));

        //
        
// we just loop through the collection till we find a key suitable for encryption, in the real
        
// world you would probably want to be a bit smarter about this.
        
//

        Iterator keyRingIter = pgpPub.getKeyRings();
        while (keyRingIter.hasNext())
        {
            PGPPublicKeyRing keyRing = (PGPPublicKeyRing)keyRingIter.next();

            Iterator keyIter = keyRing.getPublicKeys();
            while (keyIter.hasNext())
            {
                PGPPublicKey key = (PGPPublicKey)keyIter.next();

                if (key.isEncryptionKey())
                {
                    return key;
                }
            }
        }

        throw new IllegalArgumentException("Can't find encryption key in key ring.");
    }

    static PGPSecretKey readSecretKey(String fileName) throws IOException, PGPException
    {
        InputStream keyIn = new BufferedInputStream(new FileInputStream(fileName));
        PGPSecretKey secKey = readSecretKey(keyIn);
        keyIn.close();
        return secKey;
    }

    /**
     * A simple routine that opens a key ring file and loads the first available key
     * suitable for signature generation.
     * 
     * 
@param input stream to read the secret key ring collection from.
     * 
@return a secret key.
     * 
@throws IOException on a problem with using the input stream.
     * 
@throws PGPException if there is an issue parsing the input stream.
     
*/
    static PGPSecretKey readSecretKey(InputStream input) throws IOException, PGPException
    {
        PGPSecretKeyRingCollection pgpSec = new PGPSecretKeyRingCollection(
            PGPUtil.getDecoderStream(input));

        //
        
// we just loop through the collection till we find a key suitable for encryption, in the real
        
// world you would probably want to be a bit smarter about this.
        
//

        Iterator keyRingIter = pgpSec.getKeyRings();
        while (keyRingIter.hasNext())
        {
            PGPSecretKeyRing keyRing = (PGPSecretKeyRing)keyRingIter.next();

            Iterator keyIter = keyRing.getSecretKeys();
            while (keyIter.hasNext())
            {
                PGPSecretKey key = (PGPSecretKey)keyIter.next();

                if (key.isSigningKey())
                {
                    return key;
                }
            }
        }

        throw new IllegalArgumentException("Can't find signing key in key ring.");
    }
}

KeyBasedLargeFileProcessor.java
package com.zolly.bouncycastle;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.NoSuchProviderException;
import java.security.SecureRandom;
import java.security.Security;
import java.util.Iterator;

import org.bouncycastle.bcpg.ArmoredOutputStream;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.openpgp.PGPCompressedData;
import org.bouncycastle.openpgp.PGPCompressedDataGenerator;
import org.bouncycastle.openpgp.PGPEncryptedData;
import org.bouncycastle.openpgp.PGPEncryptedDataGenerator;
import org.bouncycastle.openpgp.PGPEncryptedDataList;
import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPLiteralData;
import org.bouncycastle.openpgp.PGPObjectFactory;
import org.bouncycastle.openpgp.PGPOnePassSignatureList;
import org.bouncycastle.openpgp.PGPPrivateKey;
import org.bouncycastle.openpgp.PGPPublicKey;
import org.bouncycastle.openpgp.PGPPublicKeyEncryptedData;
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
import org.bouncycastle.openpgp.PGPUtil;
import org.bouncycastle.openpgp.operator.jcajce.JcePGPDataEncryptorBuilder;
import org.bouncycastle.openpgp.operator.jcajce.JcePublicKeyDataDecryptorFactoryBuilder;
import org.bouncycastle.openpgp.operator.jcajce.JcePublicKeyKeyEncryptionMethodGenerator;
import org.bouncycastle.util.io.Streams;

/**
 * A simple utility class that encrypts/decrypts public key based
 * encryption large files.
 
*/
public class KeyBasedLargeFileProcessor
{
    public static void decryptFile(
        String inputFileName,
        String keyFileName,
        char[] passwd,
        String defaultFileName)
        throws IOException, NoSuchProviderException
    {
        InputStream in = new BufferedInputStream(new FileInputStream(inputFileName));
        InputStream keyIn = new BufferedInputStream(new FileInputStream(keyFileName));
        decryptFile(in, keyIn, passwd, defaultFileName);
        keyIn.close();
        in.close();
    }
    
    /**
     * decrypt the passed in message stream
     
*/
    public static void decryptFile(
        InputStream in,
        InputStream keyIn,
        char[]      passwd,
        String      defaultFileName)
        throws IOException, NoSuchProviderException
    {    
        in = PGPUtil.getDecoderStream(in);
        
        try
        {
            PGPObjectFactory        pgpF = new PGPObjectFactory(in);
            PGPEncryptedDataList    enc;

            Object                  o = pgpF.nextObject();
            //
            
// the first object might be a PGP marker packet.
            
//
            if (o instanceof PGPEncryptedDataList)
            {
                enc = (PGPEncryptedDataList)o;
            }
            else
            {
                enc = (PGPEncryptedDataList)pgpF.nextObject();
            }
            
            //
            
// find the secret key
            
//
            Iterator                    it = enc.getEncryptedDataObjects();
            PGPPrivateKey               sKey = null;
            PGPPublicKeyEncryptedData   pbe = null;
            PGPSecretKeyRingCollection  pgpSec = new PGPSecretKeyRingCollection(
                PGPUtil.getDecoderStream(keyIn));                                                                 
            
            while (sKey == null && it.hasNext())
            {
                pbe = (PGPPublicKeyEncryptedData)it.next();
                
                sKey = PGPExampleUtil.findSecretKey(pgpSec, pbe.getKeyID(), passwd);
            }
            
            if (sKey == null)
            {
                throw new IllegalArgumentException("secret key for message not found.");
            }
            
            InputStream         clear = pbe.getDataStream(new JcePublicKeyDataDecryptorFactoryBuilder().setProvider("BC").build(sKey));
            
            PGPObjectFactory    plainFact = new PGPObjectFactory(clear);
            
            PGPCompressedData   cData = (PGPCompressedData)plainFact.nextObject();
    
            InputStream         compressedStream = new BufferedInputStream(cData.getDataStream());
            PGPObjectFactory    pgpFact = new PGPObjectFactory(compressedStream);
            
            Object              message = pgpFact.nextObject();
            
            if (message instanceof PGPLiteralData)
            {
                PGPLiteralData ld = (PGPLiteralData)message;

                String outFileName = ld.getFileName();
                if (outFileName.length() == 0)
                {
                    outFileName = defaultFileName;
                }

                InputStream unc = ld.getInputStream();
                OutputStream fOut =  new BufferedOutputStream(new FileOutputStream(outFileName));

                Streams.pipeAll(unc, fOut);

                fOut.close();
            }
            else if (message instanceof PGPOnePassSignatureList)
            {
                throw new PGPException("encrypted message contains a signed message - not literal data.");
            }
            else
            {
                throw new PGPException("message is not a simple encrypted file - type unknown.");
            }

            if (pbe.isIntegrityProtected())
            {
                if (!pbe.verify())
                {
                    System.err.println("message failed integrity check");
                }
                else
                {
                    System.err.println("message integrity check passed");
                }
            }
            else
            {
                System.err.println("no message integrity check");
            }
        }
        catch (PGPException e)
        {
            System.err.println(e);
            if (e.getUnderlyingException() != null)
            {
                e.getUnderlyingException().printStackTrace();
            }
        }
    }

    public static void encryptFile(
        String          outputFileName,
        String          inputFileName,
        String          encKeyFileName,
        boolean         armor,
        boolean         withIntegrityCheck)
        throws IOException, NoSuchProviderException, PGPException
    {
        OutputStream out = new BufferedOutputStream(new FileOutputStream(outputFileName));
        PGPPublicKey encKey = PGPExampleUtil.readPublicKey(encKeyFileName);
        encryptFile(out, inputFileName, encKey, armor, withIntegrityCheck);
        out.close();
    }

    public static void encryptFile(
        OutputStream    out,
        String          fileName,
        PGPPublicKey    encKey,
        boolean         armor,
        boolean         withIntegrityCheck)
        throws IOException, NoSuchProviderException
    {    
        if (armor)
        {
            out = new ArmoredOutputStream(out);
        }
        
        try
        {    
            PGPEncryptedDataGenerator   cPk = new PGPEncryptedDataGenerator(new JcePGPDataEncryptorBuilder(PGPEncryptedData.CAST5).setWithIntegrityPacket(withIntegrityCheck).setSecureRandom(new SecureRandom()).setProvider("BC"));
                
            cPk.addMethod(new JcePublicKeyKeyEncryptionMethodGenerator(encKey).setProvider("BC"));
            
            OutputStream                cOut = cPk.open(out, new byte[1 << 16]);
            
            PGPCompressedDataGenerator  comData = new PGPCompressedDataGenerator(
                                                                    PGPCompressedData.ZIP);
                                                                    
            PGPUtil.writeFileToLiteralData(comData.open(cOut), PGPLiteralData.BINARY, new File(fileName), new byte[1 << 16]);
            
            comData.close();
            
            cOut.close();

            if (armor)
            {
                out.close();
            }
        }
        catch (PGPException e)
        {
            System.err.println(e);
            if (e.getUnderlyingException() != null)
            {
                e.getUnderlyingException().printStackTrace();
            }
        }
    }

    public static void main(
        String[] args)
        throws Exception
    {
        Security.addProvider(new BouncyCastleProvider());
        
        decryptFile("Encypted File.txt.pgp", "Key.asc", "123456789".toCharArray(), "Encypted File.txt");
    }
}


zolly 2013-05-24 08:37 发表评论
]]>
SQL删除某些字段重复的记?只保留一?http://www.aygfsteel.com/zolly/archive/2013/05/03/SQL_Delete_Duplication.htmlzollyzollyThu, 02 May 2013 16:30:00 GMThttp://www.aygfsteel.com/zolly/archive/2013/05/03/SQL_Delete_Duplication.htmlhttp://www.aygfsteel.com/zolly/comments/398697.htmlhttp://www.aygfsteel.com/zolly/archive/2013/05/03/SQL_Delete_Duplication.html#Feedback0http://www.aygfsteel.com/zolly/comments/commentRss/398697.htmlhttp://www.aygfsteel.com/zolly/services/trackbacks/398697.html?x)员数据需要用到的是下面三个字D?ID(自增),MemberName,MemberAddress.只要?x)员姓名与?x)员地址相同p为是重复记录,重复记录在删除时只保留ID最大的那个.SQL如下:

delete MemberInfo where ID not in (
select max(ID) from MemberInfo group by MemberName, MemberAddress)

not in的效率可能会(x)低些,但因为是直接操作数据?所以这q不重要.q个句子q是非常的简单有效的.
在真正的删除操作?通常?x)先了解一下重复记录的情况.可以使用下面的句?

SELECT COUNT(MemberName) AS TheCount, MemberName, MemberAddress
FROM MemberInfo
GROUP BY MemberName, MemberAddress
HAVING (COUNT(*> 1)


zolly 2013-05-03 00:30 发表评论
]]>
国z杉矶申L(fng)?x)安全?Social Security Number)指南http://www.aygfsteel.com/zolly/archive/2012/12/14/Apply_US_SSN.htmlzollyzollyThu, 13 Dec 2012 23:15:00 GMThttp://www.aygfsteel.com/zolly/archive/2012/12/14/Apply_US_SSN.htmlhttp://www.aygfsteel.com/zolly/comments/392961.htmlhttp://www.aygfsteel.com/zolly/archive/2012/12/14/Apply_US_SSN.html#Feedback0http://www.aygfsteel.com/zolly/comments/commentRss/392961.htmlhttp://www.aygfsteel.com/zolly/services/trackbacks/392961.html到美国后W二周开始申L(fng)保安全号?

在社?x)安全局|站?https://secure.ssa.gov/apps6z/FOLO/fo001.jsp)Ҏ(gu)所在地区的邮政~码查询到服务该地区的Social Security Office。office的一般工作时间是周一到周五,早上9点到下午5点,国定假日不开放?/div>

在Metro|站上查询\U?http://socaltransport.org/tm2_text.php)。坐Metro公交车到那里后已l?Q?0了,大概100q米的大厅中坐满了hQ??0人的样子Qd?个窗口,心想要等一上午了。首先在门口的排h上取了一个号码Q79Q然后走到大厅后面的桌子上取了一份申误开始填Q这时听到广播报Q73?L(fng)口,我一下子兴奋hQ这么快阿,2分钟填好表格后已lQ76了。后来发现大厅里做的大部分h都是甌退休阿Q修改地址{的Q可能对新申L(fng)有专门的H口?/div>

轮到我了Q我?L(fng)口,一个阿三摸L(fng)姑娘问我需要什么服务,我说甌新卡Q然后她要求我出CZ护照QVisaQI-94Q准备出CI-797的,她说不用了,然后问我是否是第一ơ来国Q我说是Q然后她录入、扫描等Q?分钟后就递给一张确认单Q说1?周,卡就?x)寄l我?/div>

从头到尾不到半个时Q一分钱没花Q效率还比较高?/div>


zolly 2012-12-14 07:15 发表评论
]]>Pega引入Apache POI读Excelhttp://www.aygfsteel.com/zolly/archive/2012/09/12/Pega_POI_Excel.htmlzollyzollyWed, 12 Sep 2012 14:43:00 GMThttp://www.aygfsteel.com/zolly/archive/2012/09/12/Pega_POI_Excel.htmlhttp://www.aygfsteel.com/zolly/comments/387600.htmlhttp://www.aygfsteel.com/zolly/archive/2012/09/12/Pega_POI_Excel.html#Feedback0http://www.aygfsteel.com/zolly/comments/commentRss/387600.htmlhttp://www.aygfsteel.com/zolly/services/trackbacks/387600.htmlread xls - before Excel 2007
try {
    PRFile file =new PRFile("Excel File Name.xls");

    java.io.BufferedInputStream in = new java.io.BufferedInputStream(
            new PRInputStream(file));

    // open HSSFWorkbook
    org.apache.poi.poifs.filesystem.POIFSFileSystem fs = new org.apache.poi.poifs.filesystem.POIFSFileSystem(
            in);
    org.apache.poi.hssf.usermodel.HSSFWorkbook wb = new org.apache.poi.hssf.usermodel.HSSFWorkbook(
            fs);
    org.apache.poi.hssf.usermodel.HSSFCell cell = null;
    for (int sheetIndex = 0; sheetIndex < wb.getNumberOfSheets(); sheetIndex++) {
        org.apache.poi.hssf.usermodel.HSSFSheet st = wb
                .getSheetAt(sheetIndex);
        for (int rowIndex = 0; rowIndex <= st.getLastRowNum(); rowIndex++) {
            org.apache.poi.hssf.usermodel.HSSFRow row = st
                    .getRow(rowIndex);
            if (row == null) {
                continue;
            }

            String strJobName = "";
            cell = row.getCell(0);
            strJobName = cell.getStringCellValue().trim();
            ClipboardProperty propJobName = myStepPage.getProperty(".Jobs(<append>).JobName");
            propJobName.setValue(strJobName);
        }
    }
    in.close();
catch (java.io.FileNotFoundException e) {
    oLog.error(e.getMessage());
catch (java.io.IOException e) {
    oLog.error(e.getMessage());
}

Excel 2007 or later
try {
    PRFile file =new PRFile("Excel File Name.xlsx");

    java.io.BufferedInputStream in = new java.io.BufferedInputStream(
            new PRInputStream(file));
    // open XSSFWorkbook
    org.apache.poi.openxml4j.opc.OPCPackage docPackage = org.apache.poi.openxml4j.opc.OPCPackage
            .open(in);

    org.apache.poi.xssf.usermodel.XSSFWorkbook wb = new org.apache.poi.xssf.usermodel.XSSFWorkbook(
            docPackage);
    org.apache.poi.xssf.usermodel.XSSFCell cell = null;
    for (int sheetIndex = 0; sheetIndex < wb.getNumberOfSheets(); sheetIndex++) {
        org.apache.poi.xssf.usermodel.XSSFSheet st = wb
                .getSheetAt(sheetIndex);
        for (int rowIndex = 0; rowIndex <= st.getLastRowNum(); rowIndex++) {
            org.apache.poi.xssf.usermodel.XSSFRow row = st
                    .getRow(rowIndex);
            if (row == null) {
                continue;
            }

            String strJobName = "";
            cell = row.getCell(0);
            strJobName = cell.getStringCellValue().trim();
            ClipboardProperty propJobName = myStepPage.getProperty(".Jobs(<append>).JobName");
            propJobName.setValue(strJobName);
        }
    }
    in.close();
catch (java.io.FileNotFoundException e) {
    oLog.error(e.getMessage());
catch (java.io.IOException e) {
    oLog.error(e.getMessage());
catch (org.apache.poi.openxml4j.exceptions.InvalidFormatException e) {
    oLog.error(e.getMessage());
}


zolly 2012-09-12 22:43 发表评论
]]>BPM中文论坛推荐http://www.aygfsteel.com/zolly/archive/2011/10/13/BPMCN.htmlzollyzollyThu, 13 Oct 2011 06:52:00 GMThttp://www.aygfsteel.com/zolly/archive/2011/10/13/BPMCN.htmlhttp://www.aygfsteel.com/zolly/comments/361149.htmlhttp://www.aygfsteel.com/zolly/archive/2011/10/13/BPMCN.html#Feedback1http://www.aygfsteel.com/zolly/comments/commentRss/361149.htmlhttp://www.aygfsteel.com/zolly/services/trackbacks/361149.htmlhttp://bpmcn.5d6d.com/bbs.php
该论坛旨在ؓ(f)BPM相关专业人员Q开发h员或者感兴趣的h提供一个互动交的q_?br />坛主做过5qPega BPM开发,所以目前论中Pega BPM话题居多QPega BPM在国内ƈ不被大多人知道,但是它在BPM国际市场上的领头。所?大树(wi)底下好乘?Q不知道未来?x)怎么P但是臛_B(ti)PM领域是近几年的热点,它随着云计,物联|一h?011q的热点词汇QBPM在不久的来在中国必成Z业高端应用的典范?img src ="http://www.aygfsteel.com/zolly/aggbug/361149.html" width = "1" height = "1" />

zolly 2011-10-13 14:52 发表评论
]]>
怎样取得临时文g夹StaticContent中文件的l对路径http://www.aygfsteel.com/zolly/archive/2010/10/20/GetRealPathOfTempDic.htmlzollyzollyWed, 20 Oct 2010 04:44:00 GMThttp://www.aygfsteel.com/zolly/archive/2010/10/20/GetRealPathOfTempDic.htmlhttp://www.aygfsteel.com/zolly/comments/335677.htmlhttp://www.aygfsteel.com/zolly/archive/2010/10/20/GetRealPathOfTempDic.html#Feedback0http://www.aygfsteel.com/zolly/comments/commentRss/335677.htmlhttp://www.aygfsteel.com/zolly/services/trackbacks/335677.html
file://web:/StaticContent/global/ServiceExport/文g.xls

有时候需要取得这个文件在服务器上的绝对\径,Ҏ(gu)如下Q?br />
String strFileName = "file://web:/StaticContent/global/ServiceExport/文g.xls";
String myFileRealPath = com.pega.pegarules.storage.FileStorageManager.getRealPathForFile(strFileName);


zolly 2010-10-20 12:44 发表评论
]]>
解决 SQL Server 2005 中文qhttp://www.aygfsteel.com/zolly/archive/2010/08/17/SQLServer2005ChineseCharacter.htmlzollyzollyTue, 17 Aug 2010 09:23:00 GMThttp://www.aygfsteel.com/zolly/archive/2010/08/17/SQLServer2005ChineseCharacter.htmlhttp://www.aygfsteel.com/zolly/comments/329124.htmlhttp://www.aygfsteel.com/zolly/archive/2010/08/17/SQLServer2005ChineseCharacter.html#Feedback0http://www.aygfsteel.com/zolly/comments/commentRss/329124.htmlhttp://www.aygfsteel.com/zolly/services/trackbacks/329124.html
如果SQL Server 2005pȝ排序规则?SQL_Latin1_General_CP1_CI_AS"Q那么数据库及数据库字段排序规则都默认ؓ(f)"SQL_Latin1_General_CP1_CI_AS"Q如果字Dؓ(f)varcharQ插入中文,数据库显CZؓ(f)"?????"Q且数据无法修复。解军_法如下:(x)

1?修改字段排序规则?Chinese_PRC_CI_AS"Qvarchar改nvarcharQSQL插入语句中,中文字符前加"N"Q可以插入中文字W?br /> 2?修改数据库排序规则ؓ(f)"Chinese_PRC_CI_AS"Q字D保持varcharQSQL语句不变Q插入中文失败,查看字段属性后发现Q字D|序规则实际上没有变化Q还是默认ؓ(f)"SQL_Latin1_General_CP1_CI_AS"Q再修改字段排序规则Qvarchar不变QSQL不变Q可以插入中文字W?br />
ȝQ?br /> 1?修改pȝ排序规则没有试过?br /> 2?修改数据库排序规则不?x)把数据库中字段的排序规则改掉,但是Z昄中文Q数据库排序规则必须攏V?br /> 3?仅仅修改字段排序规则Q还不能完全解决问题?img src ="http://www.aygfsteel.com/zolly/aggbug/329124.html" width = "1" height = "1" />

zolly 2010-08-17 17:23 发表评论
]]>
无法解决 equal to 操作?"SQL_Latin1_General_CP1_CI_AS" ?"Chinese_PRC_CI_AS" 之间的排序规则冲H?/title><link>http://www.aygfsteel.com/zolly/archive/2010/06/21/SQLServer2005Collaction.html</link><dc:creator>zolly</dc:creator><author>zolly</author><pubDate>Sun, 20 Jun 2010 16:23:00 GMT</pubDate><guid>http://www.aygfsteel.com/zolly/archive/2010/06/21/SQLServer2005Collaction.html</guid><wfw:comment>http://www.aygfsteel.com/zolly/comments/324024.html</wfw:comment><comments>http://www.aygfsteel.com/zolly/archive/2010/06/21/SQLServer2005Collaction.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zolly/comments/commentRss/324024.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zolly/services/trackbacks/324024.html</trackback:ping><description><![CDATA[<p>无法解决 equal to 操作?"SQL_Latin1_General_CP1_CI_AS" ?"Chinese_PRC_CI_AS" 之间的排序规则冲H?br /> Cannot resolve the collation conflict between SQL_Latin1_General_CP1_CI_AS and Finnish_Swedish_CI_AS in the equal to operation.</p> <p>|上有很多解军_法,但基本上都要改动SQL语句?/p> <p>工作中,从国外得C个MS SQL Server 2005的备份文Ӟ打算把他q原到本地服务器使用里面的数据?/p> <p>本地操作pȝ是MS Windows XP Professional 英文版,安装了MS SQL Server 2005 开发版Q还原数据库后,q行数据出现错误如下Q?br /> “无法解决 equal to 操作?"SQL_Latin1_General_CP1_CI_AS" ?"Chinese_PRC_CI_AS" 之间的排序规则冲H?#8221;</p> <p>查数据库发现QSQL Server 2005服务器的排序规则?Chinese_PRC_CI_AS"Q而数据库的排序规则是"SQL_Latin1_General_CP1_CI_AS"Q在|上查询得知Q原因是q两U排序规则不l一所致。我试q两U方法让他们l一Q但l果都无效:(x)<br /> 1?更改数据库的排序规则?Chinese_PRC_CI_AS"。通过SQL Server Management Studio囑Ş界面Property-Options-Collaction或SQL语句“ALTER DATABAS [DBName] COLLATE Chinese_PRC_CI_AS”更改无效?br /> 2?重构数据?#8220;setup.exe /qn INSTANCENAME=SQL2005 REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=sa2005 SQLCOLLATION=SQL_Latin1_General_CP1_CI_AS” Ҏ(gu)无效?/p> <p>后来研究了很多种Ҏ(gu)Q如下蝲SQL Server 2005企业版安装,但是企业版不适合安装在XP Professionalpȝ上,以失败告l?/p> <p>最后实在没办法Q决定在此重装SQL ServerQ推原因最可能q是本地pȝ使用了中文的排序规则Q必让本Server的地排序规则安装的时候就讄?SQL_Latin1_General_CP1_CI_AS"Q即在纯英文操作pȝ下安装SQL Server 2005Q后来实验成功。具体方法如下:(x)<br /> 1?管我的操作pȝ是XPpȝQ但?#8220;区域语言讄”中全部设|ؓ(f)中文了,当前pȝ和中文操作系l无异。要让SQL Server 2005利安装Q需要将所?#8220;区域语言讄”都切换成p(国)Q这个在中文操作pȝ中也应该有效?br /> 2?安装MS SQL Server 2005Q到“排序规则讄”界面Ӟpȝ默认选择的是以下拉框的Ş式选择排序规则的选项Q英文状态下应该默认?#8220;Latin1_General”Q?strong>切忌不要选择q个排序规则Q需要选择的是W二个单选框QSQL排序规则(用于保与旧版本的SQL Server兼容) q个选项Q在列表中选择“字典序Q不区分大小写,用于1252字符集?#8221;</strong>ok了,q就是传说中?SQL_Latin1_General_CP1_CI_AS"字符集,卌文字W集?/p> <p>SQL Server安装好后Q打开SQL Server Management Studio界面查看Server的排序规则,认?SQL_Latin1_General_CP1_CI_AS"Q重新导入外来备份文Ӟ大功告成Q?/p><img src ="http://www.aygfsteel.com/zolly/aggbug/324024.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zolly/" target="_blank">zolly</a> 2010-06-21 00:23 <a href="http://www.aygfsteel.com/zolly/archive/2010/06/21/SQLServer2005Collaction.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Legacy System (or Legacy based Application) definitionhttp://www.aygfsteel.com/zolly/archive/2009/12/18/LegacySystem.htmlzollyzollyFri, 18 Dec 2009 08:26:00 GMThttp://www.aygfsteel.com/zolly/archive/2009/12/18/LegacySystem.htmlhttp://www.aygfsteel.com/zolly/comments/306579.htmlhttp://www.aygfsteel.com/zolly/archive/2009/12/18/LegacySystem.html#Feedback1http://www.aygfsteel.com/zolly/comments/commentRss/306579.htmlhttp://www.aygfsteel.com/zolly/services/trackbacks/306579.html1. Obsolete computer system that may still be in use because its data cannot be changed to newer or standard formats, or its application programs cannot be upgraded. 
http://www.businessdictionary.com/definition/legacy-system.html
2.  An information technology or other automated system that is technologically obsolete. It may be too expensive to update or replace, but it is still needed for the companyÂ’s operations and thus is kept operational even though a newer system is in use.
http://www.yourdictionary.com/finance/legacy-system
3. Legacy system from Wikipedia (http://en.wikipedia.org/wiki/Legacy_system)

*计算机技术飞速发展,日新月异Q许多企业因Z务发展的需要和市场竞争的压力,需要徏设新的企业信息系l。在q种升攚w的q程中,怎么处理和利用那些历史遗留下来的老系l,成ؓ(f)影响新系l徏设成败和开发效率的关键因素之一。我们称q些老系lؓ(f)遗留pȝQlegacy   systemQ? 
http://topic.csdn.net/t/20050719/22/4155342.html 
    目前Q学术和工业界对遗留pȝ的定义没有统一的意见。Bennett?995q对遗留pȝ作了如下的定义[1]Q遗留系l是我们不知道如何处理但Ҏ(gu)们的l织又是臛_重要的系l。Brodie和Stonebraker寚w留系l的定义如下[2]Q遗留系l是指Q何基本上不能q行修改和进化以满新的变化了的业务需求的信息pȝ?  
    我们认ؓ(f)Q遗留系l应该具有以下特点:(x)   
    Q?Q系l虽然完成企业中许多重要的业务管理工作,但已l不能完全满求。一般实C务处理电(sh)子化及部分企业管理功能,很少涉及l营决策?  
    Q?Q系l在性能上已l落后,采用的技术已l过时。如多采用主?l端形式或小型机pȝQY件用汇~语a或第三代E序设计语言的早期版本开发,使用文gpȝ而不是数据库?  
    Q?Q通常是大型的软gpȝQ已l融入企业的业务q行和决{管理机制之中,l护工作十分困难?  
    Q?Q系l没有用现代Y件工E方法进行管理和开发,现在基本上已l没有文档,很难理解?/span>


zolly 2009-12-18 16:26 发表评论
]]>How to read and write Properties from pzPVStream column?http://www.aygfsteel.com/zolly/archive/2009/06/01/pzPVStream.htmlzollyzollyMon, 01 Jun 2009 09:22:00 GMThttp://www.aygfsteel.com/zolly/archive/2009/06/01/pzPVStream.htmlhttp://www.aygfsteel.com/zolly/comments/279433.htmlhttp://www.aygfsteel.com/zolly/archive/2009/06/01/pzPVStream.html#Feedback2http://www.aygfsteel.com/zolly/comments/commentRss/279433.htmlhttp://www.aygfsteel.com/zolly/services/trackbacks/279433.html
I don't know how Obj-Open and Obj-List work, how to read pzPVStream to get the unexposed property. Is there any general way to get the binary data form database? If the pzPVStream image data is standardized data format, if not, how the PegaSystems to write and read it.

Can we read and write column value from pzPVStream by Java code directly out of PRPC? Any body who could provide any solution?

PDN said, Rules XML stream is stored in BLOB. Generally, BLOB column is not encoded if we don't check "Encrypt BLOB?".
Developer can read information by following: it is the way to read XML Stream from CLOB column.
Reader reader = ResultSet.getCharacterStream();
I try to use this method to write the stream into file, the content is always encode. I don't know what was wrong.

zolly 2009-06-01 17:22 发表评论
]]>
PRPC JSR94 Troubleshootinghttp://www.aygfsteel.com/zolly/archive/2009/05/31/JSR94TroubleShooting.htmlzollyzollySun, 31 May 2009 10:00:00 GMThttp://www.aygfsteel.com/zolly/archive/2009/05/31/JSR94TroubleShooting.htmlhttp://www.aygfsteel.com/zolly/comments/279254.htmlhttp://www.aygfsteel.com/zolly/archive/2009/05/31/JSR94TroubleShooting.html#Feedback1http://www.aygfsteel.com/zolly/comments/commentRss/279254.htmlhttp://www.aygfsteel.com/zolly/services/trackbacks/279254.html Reference Document: jsr94service52.pdf

按照来自PDN文档jsr94service52中的JSR94 Sample一步一步重现时Q无论采用Antq是Eclipse~译q行Q都可能?x)出现如下的问题Q?br />
2009-05-31 17:14:43,500 [     user-5a57c3e103] (    etier.engine.EngineStartup) ERROR   - PegaRULES initialization failed. Server: user-5a57c3e103
com.pega.pegarules.pub.context.InitializationFailedError: PRNodeImpl init failed
    at com.pega.pegarules.engine.context.PREnvironment.getThreadAndInitialize(PREnvironment.java:
338)
    at com.pega.pegarules.etier.engine.EngineStartup.initEngine(EngineStartup.java:
456)
    at com.pega.pegarules.etier.impl.EngineImpl._initEngine_privact(EngineImpl.java:
125)
    at com.pega.pegarules.etier.impl.EngineImpl.doStartup(EngineImpl.java:
98)
    at com.pega.pegarules.priv.services.jsr94.PRRuntime.startEngine(PRRuntime.java:
327)
    at com.pega.pegarules.priv.services.jsr94.PRRuntime.getEngine(PRRuntime.java:
87)
    at com.pega.pegarules.priv.services.jsr94.PRRuntime.<init>(PRRuntime.java:
78)
    at com.pega.pegarules.priv.services.jsr94.PRAdministrator.<init>(PRAdministrator.java:
81)
    at com.pega.pegarules.pub.services.jsr94.PRuleServiceProvider.<init>(PRuleServiceProvider.java:
64)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:
27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:
513)
    at java.lang.Class.newInstance0(Class.java:
355)
    at java.lang.Class.newInstance(Class.java:
308)
    at javax.rules.RuleServiceProviderManager.registerRuleServiceProvider(RuleServiceProviderManager.java:
84)
    at javax.rules.RuleServiceProviderManager.registerRuleServiceProvider(RuleServiceProviderManager.java:
67)
    at com.pega.pegarules.pub.services.jsr94.PRuleServiceProvider.<clinit>(PRuleServiceProvider.java:
52)
    at com.pega.pegarules.sample.service.jsr94.client.SubmitClaim.run(SubmitClaim.java:
97)
Caused by: com.pega.pegarules.pub.PRRuntimeException: Method Invocation exception
    at com.pega.pegarules.engine.context.PREnvironment.doWithRequestorLocked(PREnvironment.java:
731)
    at com.pega.pegarules.engine.context.PREnvironment.doWithRequestorLocked(PREnvironment.java:
568)
    at com.pega.pegarules.engine.context.PREnvironment.getThreadAndInitialize(PREnvironment.java:
328)
     
18 more
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
    at java.lang.reflect.Method.invoke(Method.java:
597)
    at com.pega.pegarules.engine.context.PREnvironment.doWithRequestorLocked(PREnvironment.java:
729)
     
20 more
Caused by: java.lang.NoClassDefFoundError: javax/servlet/jsp/JspFactory
    at com.pega.pegarules.engine.context.PRNodeImpl.updateSystemStart(PRNodeImpl.java:
1519)
    at com.pega.pegarules.engine.context.PRNodeImpl.startNode(PRNodeImpl.java:
1157)
    at com.pega.pegarules.engine.context.PREnvironment.finishInit(PREnvironment.java:
833)
     
25 more
Caused by: java.lang.ClassNotFoundException: javax.servlet.jsp.JspFactory
    at java.net.URLClassLoader$
1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:
188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:
307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:
252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
320)
     
28 more

如果出现cMjavax.serverlet.jsp.JspFactory相关的问题,可能有两个原因引P(x)
1. 在所有引用的Jar path中,没找到javax.serverlet.jsp.JspFactorycR?br /> 2. 在多个Jar path中,都找到javax.serverlet.jsp.JspFactoryc,出现冲突?br />
在PRPC中用JSR94Q需要调用servlet-api.jarQ该jar包来自Tomcat/common/libQ查?a >http://www.findjar.com/index.jsp?query=javax.servlet.jsp.JspFactory可知在servlet-api.jar中应该(不敢肯定Q包括javax.serverlet.jsp.JspFactoryc,但程序仍然报告错误信息。从查询l果中得知在同样的目录下Q还有一个jar包jsp-api.jar也包含该cR于是,本h两个jar包同时放到Eclipse的Path中去Q结果编译运行成功。所以本人推,在apache-tomcat-5.5.17版本中,servlet-api.jar中ƈ不包含javax.serverlet.jsp.JspFactorycR?br />
如有异议Q还请高手指点,以上推断Q纯属个人愚见?img src ="http://www.aygfsteel.com/zolly/aggbug/279254.html" width = "1" height = "1" />

zolly 2009-05-31 18:00 发表评论
]]>
Business Intelligence Extract (BIX)http://www.aygfsteel.com/zolly/archive/2009/05/27/BIX.htmlzollyzollyWed, 27 May 2009 01:48:00 GMThttp://www.aygfsteel.com/zolly/archive/2009/05/27/BIX.htmlhttp://www.aygfsteel.com/zolly/comments/278149.htmlhttp://www.aygfsteel.com/zolly/archive/2009/05/27/BIX.html#Feedback0http://www.aygfsteel.com/zolly/comments/commentRss/278149.htmlhttp://www.aygfsteel.com/zolly/services/trackbacks/278149.html BIX stands for Business Intelligence Extract , enables custormer to extract SmartBPM case data for the purpose of merging it with information from other enterprise systems in a centralized data warehouse. Organizations now have the ablility to quickly and easily select and extract all BPM data including work detail, assignment in various formats including SQL tables, comma-separated-values (CSV) files, and XML files. You can directly import these outputs into popular business intelligence applications for analysis and reporting. BIX can be added to any V5.1+system.

All data available for BIX. Extract concurrentlyfrom one or multiple PRPC.

BIX actually is a PRPC rules which havd functions that can extract Property rules data including Blob data from database into SQL statement, CSV and XML format file.
BIX as an general system rules be deployed on V5.5+ system.

Please refer to: http://pdn.pega.com

zolly 2009-05-27 09:48 发表评论
]]>
Java规则引擎JSR94在PRPC中应用的调研http://www.aygfsteel.com/zolly/archive/2009/05/20/PRPCJSR94.htmlzollyzollyWed, 20 May 2009 15:35:00 GMThttp://www.aygfsteel.com/zolly/archive/2009/05/20/PRPCJSR94.htmlhttp://www.aygfsteel.com/zolly/comments/271823.htmlhttp://www.aygfsteel.com/zolly/archive/2009/05/20/PRPCJSR94.html#Feedback1http://www.aygfsteel.com/zolly/comments/commentRss/271823.htmlhttp://www.aygfsteel.com/zolly/services/trackbacks/271823.html摘自Q?/em>Java规则引擎与其API(JSR-94))

PegaRULES® JSR 94 服务可以接收来自完全独立于PRPC的外部系l的hq给出反应。PRPC实现了所有JSR94规范中的所有Java 接口Q一个外部JSR客户端程序能够通过PegaRULES引擎直接讉KPRPC数据库来dRulesQ而不l过PRPC Web应用E序Q如果PRPC Web 应用E序正在q行QJSR94客户端程序和PRPC应用E序可以作ؓ(f)完全独立的系l共享同一个PegaRULES数据库?br />
在PRPC中提供JSR94服务的Class是Rule-Service-JSR94Q当然至也需要一个ServicePackageQ一个驱动Activity?br />
PRPC为JSR94提供的Provider class 是com.pega.pegarules.pub.services.jsr94.PRuleServiceProvider?br />
下图为JSR94 Service的系l架构图Q?br />

Please Refer to: http://pdn.pega.com

zolly 2009-05-20 23:35 发表评论
]]>
Java操作MS Word -- jacob资源攉http://www.aygfsteel.com/zolly/archive/2009/05/20/Jacob.htmlzollyzollyWed, 20 May 2009 15:00:00 GMThttp://www.aygfsteel.com/zolly/archive/2009/05/20/Jacob.htmlhttp://www.aygfsteel.com/zolly/comments/271819.htmlhttp://www.aygfsteel.com/zolly/archive/2009/05/20/Jacob.html#Feedback0http://www.aygfsteel.com/zolly/comments/commentRss/271819.htmlhttp://www.aygfsteel.com/zolly/services/trackbacks/271819.htmlhttp://sourceforge.net/projects/jacob-project/

以下来自|络攉Q?/strong>

Java COM Automation with Jacob and JBuilder (?修改-另存?
http://edn.embarcadero.com/article/33305

Jacob解决Word文档的读写问?(常用操作Ҏ(gu))
http://www.cnblogs.com/xinxindiandeng/archive/2008/12/10/1351570.html

有关jacob的word操作研究 (常用较全面的操作Ҏ(gu))
http://zhuxue-feng.javaeye.com/blog/35350

Java操作Microsoft Word之jacob (123) (比较全面的操作方?
http://www.cn-java.com/www1/?action-viewnews-itemid-13102
http://tech.ddvip.com/2009-04/1239274932114206_2.html
http://shenzhenchufa.blog.51cto.com/730213/147806 (在当前文档指定的位置拯来自另一个文档中的段?

jacob的用方法ȝ (比较全面的操作方?
http://blog.csdn.net/yangyinbo/archive/2008/11/25/3373576.aspx



zolly 2009-05-20 23:00 发表评论
]]>
规则引擎 (Rule Engine)http://www.aygfsteel.com/zolly/archive/2009/05/20/RuleEngine.htmlzollyzollyWed, 20 May 2009 04:37:00 GMThttp://www.aygfsteel.com/zolly/archive/2009/05/20/RuleEngine.htmlhttp://www.aygfsteel.com/zolly/comments/271687.htmlhttp://www.aygfsteel.com/zolly/archive/2009/05/20/RuleEngine.html#Feedback0http://www.aygfsteel.com/zolly/comments/commentRss/271687.htmlhttp://www.aygfsteel.com/zolly/services/trackbacks/271687.html规则引擎出现的目的:(x)
复杂企业U项目的开发以及其中随外部条g不断变化的业务规?business logic),q切需要分d业决{者的商业决策逻辑和应用开发者的技术决{,q把q些商业决策攑֜中心数据库或其他l一的地方,让它们能在运行时Q即商务旉Q可以动态地理和修改从而提供Y件系l的柔性和适应性。规则引擎正是应用于上述动态环境中的一U解x法?br />
规则引擎出现?/strong>相关背景Q?/strong>
企业理者对企业UITpȝ的开发有着如下的要求:(x)(1)为提高效率,理程必须自动化,即C商业规则异常复杂(2)市场要求业务规则l常变化QITpȝ必须依据业务规则的变化快速、低成本的更?3)Z快速、低成本的更斎ͼ业务人员应能直接理ITpȝ中的规则Q不需要程序开发h员参与?br /> 而项目开发h员则到了以下问?(1)E序=法+数据l构Q有些复杂的商业规则很难推导出算法和抽象出数据模?2)软g工程要求从需?>设计->~码Q然而业务规则常常在需求阶D可能还没有明确Q在设计和编码后q在变化Q业务规则往往嵌在pȝ各处代码?3)对程序员来说Q系l已l维护、更新困难,更不可能让业务h员来理?br />
什么是业务规则Q?br /> 一个业务规则包含一l条件和在此条g下执行的操作Q它们表CZ务规则应用程序的一D业务逻辑。业务规则通常应该׃务分析h员和{略理者开发和修改Q但有些复杂的业务规则也可以由技术h员用面向对象的技术语a或脚本来定制?strong>业务规则的理论基?讄一个或多个条gQ当满q些条g时会(x)触发一个或多个操作?br />
什么是规则引擎Q?br />
规则引擎由推理引擎发展而来Q是一U嵌入在应用E序中的lgQ实C业务决{从应用E序代码中分d来,q用预定义的语义模块编写业务决{。接受数据输入,解释业务规则QƈҎ(gu)规则做出业务决策?br />
规则引擎的算法:(x)
大部分规则引擎品的法Q基本上都来自于Dr. Charles Forgy?979q提出的RETE法及其变体QRete法是目前效率最高的一个Forward-Chaining推理法QDrools目是Rete法的一个面向对象的Java实现QRete法其核心思想是将分离的匹配项Ҏ(gu)内容动态构造匹配树(wi)Q以辑ֈ显著降低计算量的效果?br />
Java规则引擎API(JSR-94)
Java规则引擎API由javax.rules包定义,是访问规则引擎的标准企业UAPI。Java规则引擎API允许客户E序使用l一的方式和不同厂商的规则引擎品交互,像使用JDBC~写独立于厂商访问不同的数据库品一栗?br />
原文请参考:(x)http://www.ibm.com/developerworks/cn/java/j-java-rules/#N10041 (Java规则引擎与其API(JSR-94))

zolly 2009-05-20 12:37 发表评论
]]>What is a Healthy PRPC System? -- Donehttp://www.aygfsteel.com/zolly/archive/2009/05/20/HealthyPRPC.htmlzollyzollyWed, 20 May 2009 01:23:00 GMThttp://www.aygfsteel.com/zolly/archive/2009/05/20/HealthyPRPC.htmlhttp://www.aygfsteel.com/zolly/comments/271649.htmlhttp://www.aygfsteel.com/zolly/archive/2009/05/20/HealthyPRPC.html#Feedback4http://www.aygfsteel.com/zolly/comments/commentRss/271649.htmlhttp://www.aygfsteel.com/zolly/services/trackbacks/271649.html我们做PRPC目的维护,试Q优化,更新{等Q都是在已有的品上的一U后l服务,都是一U?#8220;发现问题Q解决问?#8221;的思\Q这U方式往往使得目周期变长Q成本提高,q些都是客户不愿意看到的l果?br />
定义一套Healthy PRPC的准则,辑ֈq个标准后的产品才允许发布到客户Q或者在前期按照这个标准严格实施,q才是防(zhn)于未然Q未雨绸~的最好方式,即便有大的变动,后期也会(x)大大减少旉周期和h力胦力?br />
q个问题我想也许不会(x)扑ֈ标准{案Q或怹只存在于BPM开发设计管理实施的人员之间l验的潜U默化。但是找C个全面的标准,可以成ؓ(f)PRPCQ甚至BPM所遵@的标准,q就是它的意义所在?br />

Following comes from Frank:
No entry in Pega-Alerts log
Normally check the alerts log file.
That's the benchmark from Pega...and normally 500ms is the standard...any SQL/Activity , if the execution exceeds 500ms, it's not normal., we need to find out why...
That needs some expericne, you should be very familar with the table structure, and needs advacned DB knowledge.

zolly 2009-05-20 09:23 发表评论
]]>
վ֩ģ壺 ޽| | | | Ӫ| | Զ| ֣| ½| ַ| | | | ƽ| | | ƽ| ũ| Դ| ˹| Ҿ| Ͽ| ˮ| ̨ǰ| | | | ɽ| Ƹ| ɽ| | ƽ| | | | | | | ƽ| | ɽ|