How to connect to mysql database using a proxy

Folks,

I wrote a program to connect to both webpage and mysql databases. Because my internet has a firewall (proxy) I set up the internet connection like this:

System.getProperties().put("proxySet","true" );

System.getProperties().put("proxyHost", proxyHost);

System.getProperties().put("proxyPort", proxyPort);

Authenticator.setDefault(new MyAuthenticator());

The http connection works fine. However the mysql database connection gives me an error:

com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException

MESSAGE: java.net.ConnectException: Connection timed out: connect

STACKTRACE:

java.net.SocketException: java.net.ConnectException: Connection timed out: connect

at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)

at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:276)

at com.mysql.jdbc.Connection.createNewIO(Connection.java:2666)

at com.mysql.jdbc.Connection.<init>(Connection.java:1531)

at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)

at java.sql.DriverManager.getConnection(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)

at myapplication$LongTask$ActualTask.<init>(app.java:182)

at myapplication$LongTask$1.construct(app.java:121)

at myapplication.SwingWorker$2.run(SwingWorker.java:107)

at java.lang.Thread.run(Unknown Source)

** END NESTED EXCEPTION **

What can I do? Do i need to setup a SOCKS Proxies or something?

Thanks a lot!!

[1852 byte] By [wateicea] at [2007-11-26 17:30:26]
# 1
SOCKS it is.
ejpa at 2007-7-8 23:58:23 > top of Java-index,Core,Core APIs...