SQL Connecting problems
Hi, and sry for my english
i am having problems to connect to a sql database
the sql DB is from a web host with php and MySql.
I had tried with this driver: com.mysql.jdbc.Driver
and I did this:
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection conexao = DriverManager.getConnection("jdbc:mysql://"+host+"/"+DBname, user , password);
the host name (host) is this: sql4.prohosts.org
What's wrong?
I have to use other Driver?
Is not possible to connect to this type of sql server?
the hostname is wrong?
please help me ;)
[691 byte] By [
rj123a] at [2007-11-27 3:52:42]

# 2
Sory for the few info
SqlException
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.ConnectException
MESSAGE: Connection timed out
STACKTRACE:
java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
(...)
The exception is throwed +/- 40 sec after trying
tkx
# 6
Is the mysql server actually up and running and accessible? Is it localhost or an external host? If external, open a command prompt and try to telnet to the hostname and port. Assuming that the server is running at the default port of 3306:
telnet hostname 3306
Do you get connection or not?