import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Properties; public class Sarga { public void start() { Properties pro = loadConfig(); DataService ds = new DataService(new Mariadb(pro)); for(Employee emp : ds.getEmployees()) { System.out.println(emp.name); } } public Properties loadConfig() { Properties pro = null; try { pro = tryLoadConfig(); } catch (Exception e) { System.err.println(e.getMessage()); } return pro; } public Properties tryLoadConfig() throws FileNotFoundException, IOException { Properties pro =new Properties(); pro.load(new FileInputStream("config.properties")); pro.getProperty("Első"); return pro; } }