Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Communications link failure

 
Prasad prap
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author
Saloon Keeper
Posts: 4015
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PLEASE do not put JDBC code inside of a JSP. It's really really bad.
 
Prasad prap
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21137
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prapia prap wrote:Is it because my TCS port is 3306 and url parameter in DriverManager is http://127.0.0.1:8080?


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
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am still getting this issue. I have googled this a lot and didnt find any solution.



my CLASSPATH


 
Mahesh Kedari
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please post the connection string you are using... Probably it is incorrect...!!!
 
Smitesh Shinde
Ranch Hand
Posts: 45
Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Are you passing a blank password??? probably that is the problem. Can you try with some password other than blank?
 
Prasad prap
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there is no password for the database. I dont think that no password is an issue
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic