String dbUrl = ConfigUtil.getValue("database.url"); String username = ConfigUtil.getValue("database.username"); String password = ConfigUtil.getValue("database.password"); Connection con = DriverManager.getConnection(dbUrl, username, password); String logLevel = ConfigUtil.getValue("log.level"); String logOutput = ConfigUtil.getValue("log.output"); Logger logger = Logger.getLogger("com.example"); logger.setLevel(Level.parse(logLevel)); logger.addHandler(new FileHandler(logOutput)); String apiKey = ConfigUtil.getValue("service.apiKey"); String serviceUrl = ConfigUtil.getValue("service.url"); ServiceClient client = new ServiceClient(apiKey, serviceUrl); client.doSomething();


上一篇:
下一篇:
切换中文