开发者博客:[url]http://www.developsearch.com[/url]
/**
* --------------------------------------
* @description 读取config下的application.properties
* @author chenxin
* @since 2011-10-25
* --------------------------------------
*/
public class ApplicationParam {
public static String dbURL;
public static String dbCLASSNAME;
public static String dbNAME;
public static String dbPWD;
public static String WEBCOLOR;
static{
ResourceBundle rs = ResourceBundle.getBundle("config/application");
try{
dbURL = rs.getString("purete.database.hsqldb.url");
dbCLASSNAME = rs.getString("purete.database.hsqldb.driverClassName");
dbNAME = rs.getString("purete.database.hsqldb.username");
dbPWD = rs.getString("purete.database.hsqldb.password");
WEBCOLOR = rs.getString("purete.web.style.color");
}catch(Exception ex){}
}
public static void main(String[] args){
ApplicationParam a = new ApplicationParam();
System.out.println(a);
System.out.println(a.WEBCOLOR);
}
}