Java & Spring/도움이 되는
Properties 사용 예제
데르벨준
2014. 1. 2. 23:14
반응형
public class ConnectionPropertyTest { public static void main(String[] args) { Properties properties = new Properties(); try { properties.loadFromXML(new FileInputStream("connection_properties.xml")); String root = (String)properties.get("root"); System.out.println(root); String max = (String)properties.get("max"); System.out.println(max); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }
root 100
반응형