1: …… 2: public void f() { 3: try { 4: InitialContext ctx = new InitialContext(); 5: DataSource datasource = (DataSource) ctx.lookup("jdbc:ocl:orcl"); 6: Connection con = datasource.getConnection(); 7: Properties props = new Properties(); 8: String fileName = "file.properties"; 9: FileInputStream in = new FileInputStream(fileName); 10: props.load(in); 11: 12: // catalog정보는 외부로부터 유입되는 정보 13: String catalog = props.getProperty("catalog"); 14: // catalog정보를 DB Connection을 위해서 해당 값을 체크하지 않고, DB 카탈 로그 정보에 지정함 15: con.setCatalog(catalog); 16: con.close(); 17: } catch (SQLException ex) { 18: System.err.println("SQLException Occured"); 19: } catch (NamingException e) { 20: System.err.println("NamingException Occured"); 21: } catch (FileNotFoundException e) { 22: System.err.println("FileNotFoundException Occured"); 23: } catch (IOException e) { 24: System.err.println("IOException Occured"); 25: } 26: } 27: ……