标签:
适用于不同的数据库
//读取配置文件(属性文件)工具类
1 public class Configmanafer{ 2 private static ConfigManager configNanager; 3 //properties.load(InputStream)读属性文件 4 private static Properties pro; 5 private ConfigManafer(){ 6 String configFile="database.properties"; 7 properties=new properties; 8 InputStream in=ConfigManger.class.getClassLoader().getResourceAsStream(configFile); 9 try{ 10 properties.load(in); 11 in.close(); 12 } 13 } 14 15 public static ConfigManager getInstance(){ 16 if(ConfigManager ){ 17 configManager=new configManager(); 18 } 19 return configManager; 20 } 21 //根据属性文件的key获取vaule 22 public String getString(String key){ 23 return properties.getString(); 24 25 } 26 }
jdbc 控制文件
标签:
原文地址:http://www.cnblogs.com/wanghongjie/p/4545289.html