Friday, May 21, 2010

Reading from Properties File

static {
InputStream is = null;
try {
is = DataSource.class.getClassLoader().getResourceAsStream(
"LocalDS.properties");
objDSProp = new Properties();
objDSProp.load(is);
String Value = objDSProp.getProperty("key");


} catch (IOException e) {
e.printStackTrace();
} finally {
if (is != null) {
try {
is.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}

}

No comments:

Post a Comment