大家好,
目前我想要连线至SSH然后再连到Mysql得到database资料,
可是到
conn = DriverManager.getConnection (url, dbuserName, dbpassword);
这行就会发生exception
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago.
The driver has not received any packets from the server.
Caused by: java.net.ConnectException: failed to connect to localhost/127.0.0.1 (port 3306): connect failed: ECONNREFUSED (Connection refused)
试了很多方法结果都还是一样,
目前是在Android Studio上用Java撰写Android的App
请问有人发生过类似的情形吗?
下面我简化之后的code
http://codepad.org/kwwZv05Z
谢谢大家。