A Common Problem with Connectivity
I have a computer which im treating as a database server (yes, a very weak one...) My problem is that I cannot access the server database from my computer. I've seen this problem ALOT and i've tried all of their answers and they dont seem to be working for me.
My goodies:
import java.sql.*;
publicclass starter
{
public starter()
{
Connection connection =null;
try
{
// Load the JDBC driver
String driverName ="com.mysql.jdbc.Driver";// MySQL MM JDBC driver
Class.forName(driverName).newInstance();
// Create a connection to the database
String serverName ="127.0.0.1:3306";//place server IP here right?
String mydatabase ="DBname";
String url ="jdbc:mysql://" + serverName +"/" + mydatabase;// a JDBC url
String username ="root";
String password ="myPassword";
connection = DriverManager.getConnection(url, username, password );
System.out.println(""+connection );
}
catch (Exception e)
{
System.out.println( e );
}
}
publicstaticvoid main( String args[] )
{
new starter();
}
}
So it compiles and works as is, BUT thats only because the IP is set to localhost. When I place the other computers IP in the 'serverName' field, it DOES NOT WORK! I can't figure this out and some help would be much appreciated.
Thanks for any advice!

