This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

My SQL connectionproblem

 
Mathews P Srampikal
Ranch Hand
Posts: 211
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am connecting to My SQL database using the below code. But am getting an exception below.

Class.forName("com.mysql.jdbc.Driver");//works fine
System.out.println("My SQL driver loaded: ");
Connection conn = DriverManager.getConnection ("jdbc:mysql://10.1.5.23:3306/mysql", "root", "root");
System.out.println("Connected to My SQL database........ ");

Exception is >>>>>>>>

com.mysql.jdbc.CommunicationsException: Communications link failure

Last packet sent to the server was 0 ms ago.

Please help.

Thanks,
Mats.
 
Vijitha Kumara
Bartender
Posts: 3908
9
Chrome Fedora Hibernate
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check mysql server (mysqld) is running. Try connecting to mysql through command prompt.Have you try that?
[ September 17, 2008: Message edited by: Vijitha Kumara ]
 
Sherif Shehab
Ranch Hand
Posts: 485
Android Eclipse IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
like Vijitha said check the connection between you and the db server
 
Mathews P Srampikal
Ranch Hand
Posts: 211
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Sever is running and am able to see data in the DB server

Thanks,
Mats
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic