Connection Problems
Posted by: John Cartner
Date: October 24, 2004 05:55PM

hi, i hope you can help us, we wrote a java applet which have to communicate with a mysql database. If the applet runs on the same computer where the mysql server is running, the programm is able to connect with the server, otherwise not. and this is not a driver problem (i even changed the driver with no effect). the diver is initated.

the code:

protected Connection getConnection ( String host, String database,String user,String pass )
throws Exception {

String url = "";
try {
url = "jdbc:mysql://" + host + "/" + database;
Connection con = DriverManager.getConnection(url,user,pass);
strstatus=strstatus.concat("Connection established (2)");
System.out.println("Connection established to " + url + "...");

return con;
} catch ( java.sql.SQLException e ) {
strstatus=strstatus.concat("Connection couldn't be established (2)");
System.out.println("Connection couldn't be established to " + url);
throw ( e );

The applet should run on this server:
Operating system Linux
Service Status Click to View
Kernel version 2.4.26-ow3
Machine Type i686
Apache version 1.3.32 (Unix)
PERL version 5.8.0
Path to PERL /usr/bin/perl
Path to sendmail /usr/sbin/sendmail
Installed Perl Modules Click to View
PHP version 4.3.9
MySQL version 4.0.20-standard
cPanel Build 9.9.8-STABLE 6

But I also wasn't able to get a connection to the database when I tried another mysql server (winXP pro). The same problem. Running the applet on the server itself I get a connection, but not from another computer.

Options: ReplyQuote

Written By
Connection Problems
October 24, 2004 05:55PM
October 26, 2004 06:37PM
November 04, 2004 12:49PM
November 16, 2004 07:01PM
January 27, 2005 07:03PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.