String userdir = System.getProperty("user.dir") + File.separator + "conf" + File.separator;
Properties prop = new Properties();
FileInputStream in;
try {
in = new FileInputStream(userdir+"/conf.properties");
prop.load(new InputStreamReader(in,"UTF-8"));
} catch (FileNotFoundException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String url = prop.getProperty("url");
String userName = prop.getProperty("userName");//账号
String password = prop.getProperty("password");//密码
String driverName = prop.getProperty("driverName");//驱动