程序中不应使用空的密码值,程序所需密码应从配置文件中获取加密的密码值。

    1. public Connection getConnection(){
    2. String url = EncryptUtil.decrypt(PropertiesUtil.get("connection.url"));
    3. String name = EncryptUtil.decrypt(PropertiesUtil.get("connection.username"));
    4. String password = EncryptUtil.decrypt(PropertiesUtil.get("connection.password"));
    5. ...
    6. }