程序中不应使用空的密码值,程序所需密码应从配置文件中获取加密的密码值。
public Connection getConnection(){
String url = EncryptUtil.decrypt(PropertiesUtil.get("connection.url"));
String name = EncryptUtil.decrypt(PropertiesUtil.get("connection.username"));
String password = EncryptUtil.decrypt(PropertiesUtil.get("connection.password"));
...
}