Java properties file example

        Properties prop = new Properties();
        try {
            //load a properties file from class path, inside static method
            prop.load(new FileInputStream("newproperties.properties"));
        } catch (IOException ex) {
            Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
        }

        System.out.println(prop.get("email"));

Comments

Popular posts from this blog

How to get Active Transactions and Locks from MySQL

Example of a PAC file