473,236 Members | 1,660 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,236 software developers and data experts.

Error with MySql

I have a connection to a server and my database. I use it like this in my code :

Expand|Select|Wrap|Line Numbers
  1. Class.forName("com.mysql.jdbc.Driver");
  2. String DBurl = "jdbc:mysql://138.63.222.7:3306/ns3";
  3. m_connection = DriverManager.getConnection(DBurl,"root",""); 
  4.  
It works fine if I start the applet on the server but not on a distant computer. I have a timeout error :

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

** BEGIN NESTED EXCEPTION **

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

STACKTRACE:
java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at com.mysql.jdbc.StandardSocketFactory.connect(Stand ardSocketFactory.java:256)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:271)
at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:2744)
at com.mysql.jdbc.Connection.<init>(Connection.java:1 553)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:285)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at ConnexionMdb.ouvrirConnexion(ConnexionMdb.java:16)
at ConnexionMdb.executeRequeteSelect(ConnexionMdb.jav a:101)
at ParamDao.get(ParamDao.java:19)
at TestConnexion.init(TestConnexion.java:30)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

** END NESTED EXCEPTION **

Last packet sent to the server was 0 ms ago.

If someone have an idea how to solve this problem. Thanks in advance
Jul 30 '07 #1
1 1884
madhoriya22
252 100+
I have a connection to a server and my database. I use it like this in my code :

Expand|Select|Wrap|Line Numbers
  1. Class.forName("com.mysql.jdbc.Driver");
  2. String DBurl = "jdbc:mysql://138.63.222.7:3306/ns3";
  3. m_connection = DriverManager.getConnection(DBurl,"root",""); 
  4.  
It works fine if I start the applet on the server but not on a distant computer. I have a timeout error :

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

** BEGIN NESTED EXCEPTION **

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

STACKTRACE:
java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at com.mysql.jdbc.StandardSocketFactory.connect(Stand ardSocketFactory.java:256)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:271)
at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:2744)
at com.mysql.jdbc.Connection.<init>(Connection.java:1 553)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:285)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at ConnexionMdb.ouvrirConnexion(ConnexionMdb.java:16)
at ConnexionMdb.executeRequeteSelect(ConnexionMdb.jav a:101)
at ParamDao.get(ParamDao.java:19)
at TestConnexion.init(TestConnexion.java:30)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

** END NESTED EXCEPTION **

Last packet sent to the server was 0 ms ago.

If someone have an idea how to solve this problem. Thanks in advance
Hi,
It means that ur 'distant computer' is not responding right now. It is not able to connect to remote address or port.
Make sure u r providing right IP address.
Thanks and regards,
madhoriya
Jul 30 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Wayno | last post by:
My php logs are coming up empty. I have done all I can think of, and all that made sense to me. Can someone take a look at my php.ini please and tell me what you think may be the problem. I...
1
by: Maciej Paras | last post by:
Hello! I've written 2 pages: one i HTML format, and second - in ASP. When I'm posting data from HTML page, I receive this error generated by ASP page: Microsoft JET Database Engine (0x80040E14)...
0
by: tevans | last post by:
I'm using Slackware GNU/Linux 9.0 on an Intel PII 266 machine that's SMP capable, but only with one CPU installed, and 64MB of RAM. It's basically a small test system that I play around with in...
0
by: Ola Ogunneye | last post by:
--=_075912CF.F899D547 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hello again all, I have created an account in the particular database that I was trying to...
0
by: Morten Gulbrandsen | last post by:
C:\mysql\bin>mysql -u elmasri -pnavathe company Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 29 to server version: 4.1.0-alpha-max-debug Type...
0
by: Morten Gulbrandsen | last post by:
mysql> USE company; Database changed mysql> mysql> DROP TABLE IF EXISTS EMPLOYEE; -------------- DROP TABLE IF EXISTS EMPLOYEE -------------- Query OK, 0 rows affected (0.00 sec)
8
by: John | last post by:
Hello. I am currently working through a book on Dreamweaver and using PHP. I am having a little trouble with setting up the database though. I have php 4.2.3 and MySQL 4.0.20a. I am running...
3
by: Pugi! | last post by:
On a freshly installed Fedora C3 (incl. webserver apache php mysql) i get the following problem when connecting to mysql through a browser (phpMyAdmin): : #2002 Can't connect to local MySQL...
1
by: jiing | last post by:
Now let me describe what I have done and my purpose: Originally, I want to user ports to install phpBB But I found that phpBB doesn't support mysql 5.x (but the ports installed mySQL 5.0.0...
1
by: Steve Ametjan | last post by:
I've been trying to get MySQL-python to install on Leopard for the past couple of days, and I keep running into relatively the same error. I'm hoping that someone on this list will be able to...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.