I have already installed Mysql on my computer and I have already created my database. I have also created a Java program that connects to the database using the code attached below. If I publish the program, will the connection to the database work correctly on other users' computers? Will it be a problem if the code is in "localhost"?
Thanks to everyone who will help me!
public static Connection getConnection() throws Exception{
try {
String url = "jdbc:mysql://localhost:3306/mybooks?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC";
String username = "root";
String password = "mypassword";
Connection conn = DriverManager.getConnection(url, username, password);
return conn;
} catch (Exception e) {
System.out.println(e);
}
return null;
}