Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-05-2007, 10:02 PM   #1
Registered: Jan 2003
Location: Hong Kong,China
Distribution: Slackware,OpenSUSE
Posts: 472

Rep: Reputation: 30
Java JDBC-Exception: Communications link failure


Recently,I have been playing around with Java and JDBC using MySQL database,which is my favourite.However,after I put the mysql-connector...jar to my JDK installation location /usr/local/jdk1.6/jre/lib/ext/.jar and I used the sample script on the Internet and try to connect to,it returned a failure message.

Exception: Communications link failure in the command prompt

Please drop me a line if you have any ideas with this error.Thanks a million.

The sample script goes like:
import java.sql.*;
public class MySqlConnectionUrl {
  public static void main(String [] args) {
    Connection con = null;
    try {
      Class.forName("com.mysql.jdbc.Driver") ;
      System.out.println("MySQL JDBC driver loaded ok.");
       con = DriverManager.getConnection(
        + "user=user&password=mypasswd");
      System.out.println("Connected with host:port/database.");
    catch (Exception e) {
      System.err.println("Exception: "+e.getMessage());
Old 12-06-2007, 12:12 AM   #2
Senior Member
Registered: Jul 2003
Posts: 1,257

Rep: Reputation: 48
Does starting to read from here help?

Perhaps you can post to the java forum above

Also see (perhaps another good forum to consider):


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
jdbc mysql java - please help me j0hnd0e Linux - Software 2 07-22-2006 06:23 AM
Java JDBC driver mickeyboa Fedora 2 07-23-2005 08:53 AM
jdbc connection in java balanagireddy Programming 2 07-01-2004 07:42 AM
JDBC connection in java balanagireddy Programming 1 06-30-2004 08:34 AM
I was working with jdbc in java in which we need navalarora Linux - Software 0 12-05-2003 07:41 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:18 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration