I have a Java
application and a MySQL
database connected to this application on my machine. The application will be distributed to other machines on the same network, but I can not make the banco de dados
connection to other machines.
The connection works fine locally, however, when I try to run the application on another machine on the same network, the connection fails. In MySQL I can access the database remotely. This is the connection code in the Java
application (I am using NetBeans
).
String connectionUrl = "jdbc:mysql://NOMEDOSERVER:3306/DB";
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection(connectionUrl, "root", "SENHA");