| Author |
Communications link failure
|
Prasad prap
Greenhorn
Joined: Sep 26, 2008
Posts: 26
|
|
Hi
I have been trying this code but to my failure i get this message
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
ERROR:
My CODE extract:
WHAT COULD BE THE PROBLEM?
|
 |
Scott Selikoff
Saloon Keeper
Joined: Oct 23, 2005
Posts: 3652
|
|
|
PLEASE do not put JDBC code inside of a JSP. It's really really bad.
|
My Blog: Down Home Country Coding with Scott Selikoff
|
 |
Prasad prap
Greenhorn
Joined: Sep 26, 2008
Posts: 26
|
|
My SQL status:
mysql> status
--------------
c:/wamp/bin/mysql/mysql5.1.36/bin/mysql.exe Ver 14.14 Distrib 5.1.36, for Win32
(ia32)
Connection id: 1
Current database:
Current user: root@localhost
SSL: Not in use
Using delimiter: ;
Server version: 5.1.36-community-log MySQL Community Server (GPL)
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
TCP port: 3306
Uptime: 1 min 37 sec
Threads: 1 Questions: 4 Slow queries: 0 Opens: 15 Flush tables: 1 Open tabl
es: 8 Queries per second avg: 0.41
--------------
Is it because my TCS port is 3306 and url parameter in DriverManager is http://127.0.0.1:8080? What could be the problem?
I am gettin error in addtion to above error:
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16479
|
|
Well, yeah. If your database server is listening at port 3306, and you want to connect to the database server, then you'll want to connect to it on port 3306. Not port 8080.
|
 |
Prasad prap
Greenhorn
Joined: Sep 26, 2008
Posts: 26
|
|
I am still getting this issue. I have googled this a lot and didnt find any solution.
my CLASSPATH
|
 |
Mahesh Kedari
Ranch Hand
Joined: Nov 28, 2009
Posts: 109
|
|
|
Can you please post the connection string you are using... Probably it is incorrect...!!!
|
Regards,
Mahesh Kedari - Fidus Technologies Ltd.
|
 |
Smitesh Shinde
Ranch Hand
Joined: Feb 16, 2008
Posts: 44
|
|
You are probably still using 8080 as database port.Your connection string should be
String connectionURL = "jdbc:mysql://127.0.0.1:3306/auction";
As your web server is already running on port 8080 and you are trying to connect to the database on same port it is giving you AccessControlException.Correcting connection string should solve your purpose.
|
 |
Prasad prap
Greenhorn
Joined: Sep 26, 2008
Posts: 26
|
|
I checked with both 3306 and 8080 but not solved! MySql is at port 3306. What shud i do?
This is for keeping port 3306 in connection URL
|
 |
Mahesh Kedari
Ranch Hand
Joined: Nov 28, 2009
Posts: 109
|
|
Are you passing a blank password??? probably that is the problem. Can you try with some password other than blank?
|
 |
Prasad prap
Greenhorn
Joined: Sep 26, 2008
Posts: 26
|
|
|
there is no password for the database. I dont think that no password is an issue
|
 |
 |
|
|
subject: Communications link failure
|
|
|