java ssh关于配置文件加密的问题

package com.imcc.breakdown.util.encrypt;

import java.util.Properties;

import org.hibernate.HibernateException;
import org.hibernate.cfg.Environment;
import org.hibernate.connection.DriverManagerConnectionProvider;

import com.imcc.breakdown.action.wechat.aes.AESSecurityUtil;

//配置文件AES加密
public class MyDriverManagerConnectionProvider extends DriverManagerConnectionProvider {

public MyDriverManagerConnectionProvider() {
    super();
}

@Override
public void configure(Properties props) throws HibernateException {
        String url =props.getProperty(Environment.URL);
        String user = props.getProperty(Environment.USER);   
        String password = props.getProperty(Environment.PASS);   
        props.setProperty(Environment.USER,AESSecurityUtil.decode(user, Password.password));   
        props.setProperty(Environment.PASS, AESSecurityUtil.decode(password, Password.password));   
        props.setProperty(Environment.URL, AESSecurityUtil.decode(url, Password.password)); 
        super.configure(props);   
}

}

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐