Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Communications link failure

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Prasad prap
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
Marshal
Posts: 28271
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am still getting this issue. I have googled this a lot and didnt find any solution.



my CLASSPATH


 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you please post the connection string you are using... Probably it is incorrect...!!!
 
Ranch Hand
Posts: 45
Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
there is no password for the database. I dont think that no password is an issue
 
He repaced his skull with glass. So you can see his brain. Kinda like this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic