Hi All,

I am new to programming and facing a problem with the following peice of code

import java.net.*;

public class MySQLConnectTest{

public static void main(String args[])throws Exception{
String hostname = "59.93.55.133"; // My Router IP
Socket s = new Socket(hostname,3306);
System.out.println("Got connection!");
s.close();
}

}

I am getting the following exception

Exception in thread "main" java.net.ConnectException: Connection timed out: conn
ect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at MySQLConnectTest.main(MySQLConnectTest.java:7)

My router is not letting me to make a connection and so I cannot connect and get any data and my entire project is being stopped at the initial point. I also made sure that the full data getting on my router is diverted to me but nothing helps. BTW I am using D Link router. Any small help from you will be a great help for me. Please help. .......