Check out example codes for "java hide mysql login credentials". It will help you in understanding the concepts better.

Code Example 1

private ResourceBundle reader = null;
 try{ 
     reader = ResourceBundle.getBundle("dbconfig.properties");
     Connection conn=DriverManager.getConnection(reader.getString("db.url"),reader.getString("db.username"),reader.getString("db.password"));
 }catch(Exception e){
}

Code Example 2

/resources/dbconfig.propreties/

Code Example 3

#DB Properties
 db.driver="driverclassname"
 db.url=jdbc:mysql://localhost:3306/YOURDBNAME
 db.username=USERNAME
 db.password=PASSWORD

Learn ReactJs, React Native from akashmittal.com