'How to access local xampp from the internet (and linking to java code)?

I'm fairly new at databases, so I am struggling with accessing my local xampp from the internet (unsure whether this is the best way to go about this, welcome to any suggestions regarding this). So far,

public void connectDB() {
try {
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/salesDatabase","root","");
if(con == null) {
System.out.println("\nDB connection failed");}
else
System.out.println("\nDB connection successful");

}
catch(Exception e) {
System.out.println("exception: "+e);
}
}

works well for me to connect to a database, and use it for myself. What I am wanting to achieve is to allow my fellows to be able to access the same database. What are my options?

I have thus far changed in "C:\xampp\apache\conf\extra\httpd-xampp.conf" 'Require Local' to 'Require all granted'. What further changes do I need to incorporate, alongside in the code? Thank you so much in advance!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source