473,909 Members | 5,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error with MySql

1 New Member
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. CommunicationsE xception: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.Connec tException
MESSAGE: Connection timed out: connect

STACKTRACE:
java.net.Connec tException: Connection timed out: connect
at java.net.PlainS ocketImpl.socke tConnect(Native Method)
at java.net.PlainS ocketImpl.doCon nect(Unknown Source)
at java.net.PlainS ocketImpl.conne ctToAddress(Unk nown Source)
at java.net.PlainS ocketImpl.conne ct(Unknown Source)
at java.net.SocksS ocketImpl.conne ct(Unknown Source)
at java.net.Socket .connect(Unknow n Source)
at java.net.Socket .connect(Unknow n Source)
at java.net.Socket .<init>(Unknow n Source)
at java.net.Socket .<init>(Unknow n Source)
at com.mysql.jdbc. StandardSocketF actory.connect( StandardSocketF actory.java:256 )
at com.mysql.jdbc. MysqlIO.<init>( MysqlIO.java:27 1)
at com.mysql.jdbc. Connection.crea teNewIO(Connect ion.java:2744)
at com.mysql.jdbc. Connection.<ini t>(Connection.j ava:1553)
at com.mysql.jdbc. NonRegisteringD river.connect(N onRegisteringDr iver.java:285)
at java.sql.Driver Manager.getConn ection(Unknown Source)
at java.sql.Driver Manager.getConn ection(Unknown Source)
at ConnexionMdb.ou vrirConnexion(C onnexionMdb.jav a:16)
at ConnexionMdb.ex ecuteRequeteSel ect(ConnexionMd b.java:101)
at ParamDao.get(Pa ramDao.java:19)
at TestConnexion.i nit(TestConnexi on.java:30)
at sun.applet.Appl etPanel.run(Unk nown Source)
at java.lang.Threa d.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 1919
madhoriya22
252 Contributor
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. CommunicationsE xception: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.Connec tException
MESSAGE: Connection timed out: connect

STACKTRACE:
java.net.Connec tException: Connection timed out: connect
at java.net.PlainS ocketImpl.socke tConnect(Native Method)
at java.net.PlainS ocketImpl.doCon nect(Unknown Source)
at java.net.PlainS ocketImpl.conne ctToAddress(Unk nown Source)
at java.net.PlainS ocketImpl.conne ct(Unknown Source)
at java.net.SocksS ocketImpl.conne ct(Unknown Source)
at java.net.Socket .connect(Unknow n Source)
at java.net.Socket .connect(Unknow n Source)
at java.net.Socket .<init>(Unknow n Source)
at java.net.Socket .<init>(Unknow n Source)
at com.mysql.jdbc. StandardSocketF actory.connect( StandardSocketF actory.java:256 )
at com.mysql.jdbc. MysqlIO.<init>( MysqlIO.java:27 1)
at com.mysql.jdbc. Connection.crea teNewIO(Connect ion.java:2744)
at com.mysql.jdbc. Connection.<ini t>(Connection.j ava:1553)
at com.mysql.jdbc. NonRegisteringD river.connect(N onRegisteringDr iver.java:285)
at java.sql.Driver Manager.getConn ection(Unknown Source)
at java.sql.Driver Manager.getConn ection(Unknown Source)
at ConnexionMdb.ou vrirConnexion(C onnexionMdb.jav a:16)
at ConnexionMdb.ex ecuteRequeteSel ect(ConnexionMd b.java:101)
at ParamDao.get(Pa ramDao.java:19)
at TestConnexion.i nit(TestConnexi on.java:30)
at sun.applet.Appl etPanel.run(Unk nown Source)
at java.lang.Threa d.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
5051
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 double-checked the path to my error log. It is in /var/www/logs/php_error_log Thanks. :) -Wayne Stevenson
1
11161
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) Syntax error (missing operator) in query expression '' AND (='OFFICE DEPOT')''. "Office Depot" is the value from form. When all values are set to "*" the script generates correct results, but if its value contains any string it generates the...
0
1572
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 some free time before installing things on my larger systems. I am trying to do a fresh install of MySQL 4.0.14 (I removed the previous 3.23.56 installation, including directory structure and leftover components). I'm compiling with these options...
0
2818
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 backup Using PHPMYADMIN and I also created the same user account on the OS side. I still got the same 1064 message afterwards. I am still relatively new to Mysql and my adding user only works when I use
0
1193
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 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> select database(); +------------+ | database() | +------------+
0
3054
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
18477
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 locally with Apache 1.3.27 on Windows XP Pro. I seem to have finally got MySQL running after a lot of difficulty. In the book it says to type source C:\mysql\newland_tours.sql at the mysql> prompt, to generate the newland_tours database in my...
3
17818
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 server through socket /var/lib/mysql/mysql.sock On the website of MySQL this error is mentioned but I found no solution. In /var/log/messages the following log occurs :
1
121560
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 alpha) so I deinstall mysql5-server and mysql5-client And then I install mysql41-server and mysql41-client on FreeBSD 5.3 by ports but now , mysql is not workable
1
3021
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 help me out in solving the issue. I'd like to get this solved so I can continue developing with Django using MySQL since that's what my web server uses as well. I'd hate to have to develop using a different database engine on my local...
0
9879
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11348
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
11052
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10540
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9727
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8099
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5938
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6140
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.