Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have two file
essai.java and essai.htm

ERROR

*** SQLException attrapee ***
java.sql.SQLException: Cannot connect to MySQL server on "mon_serveur":3306.
Is there a MySQL server running on the machine/port you are trying to connect
to? (java.security.AccessControlException)
SQLState : 08S01
Message : Cannot connect to MySQL server on "mon_serveur":3306.
Is there a
MySQL server running on the machine/port you are trying to connect to? (java.se
curity.AccessControlException)
Code : 0
java.lang.NullPointerException
at essai.init(essai.java:35)
at sun.applet.AppletPanel.run(AppletPanel.java:341)
at java.lang.Thread.run(Thread.java:536)

Any help would be appreciated.

Thanks,

Mike
 
Mike,

When I connect to a MySQL database on my PC (ie localhost, not remote) I use code similar to the following :

String driver = "org.gjt.mm.mysql.Driver";
String URL = "jdbc:mysql://localhost:3306/my_database_name"

try {
Class.forName(driver).newInstance();
}
catch (Exception e) {
//some error messages ...
}

try {
Connection conn = DriverManager.getConnection(URL);
}
catch (Exception e) {
//some error messages ...
}

Make sure you have a valid mysql driver (available form MySQL website), and that it is registered with your IDE.

If the port is still responding as busy, you could try pinging it using Sockets() and stuff ....

Hope this helps, and Good Luck !

Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top