The Java Read Properties configuration file code is as follows:
String Path = System.getproperty ("User.dir") + "\\properties\\config.properties";
Properties Pro = new properties ();
FileInputStream in = new FileInputStream (path);
Pro.load (in);
System.out.println (Pro.getproperty ("DriverPath"));
System.out.println (Pro.getproperty ("username"));
System.out.println (Pro.getproperty ("password"));
System.out.println (Pro.getproperty ("Driver"));
System.out.println (pro.getproperty ("url"));
System.out.println (Pro.getproperty ("user"));
System.out.println (Pro.getproperty ("Mysql_password"));
In.close ();
Save property to B.properties file
fileoutputstream ofile = new FileOutputStream (path, false);/False to overwrite original content
Pro.setproperty ("url", "ssssssssssss");
Pro.store (Ofile, "The New properties File");
Ofile.close ();