janpihlgren
2008-11-21 07:39:20 UTC
Just installed NetBeans 6.5 and now try to run som javaprogram that require
connection to a MySQL-database.
I get this errormessage:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link
failure
and a point to these rows int the program:
String _url = "jdbc:mysql://localhost:3306/" +database;
Connection conn = DriverManager.getConnection(_url, user, pwd);
I also have these lines before:
try{
Class.forName("com.mysql.jdbc.Driver");
}
In the Library I use this:
MySQLJDBC Driver - mysql-connector-java-5.1.6-bin.jar
Before using NetBeans 6.5 I use 6.1 and MySQLJDBC Driver -
mysql-connector-java-5.1.5-bin.jar and i worked.
My question is what to do?
connection to a MySQL-database.
I get this errormessage:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link
failure
and a point to these rows int the program:
String _url = "jdbc:mysql://localhost:3306/" +database;
Connection conn = DriverManager.getConnection(_url, user, pwd);
I also have these lines before:
try{
Class.forName("com.mysql.jdbc.Driver");
}
In the Library I use this:
MySQLJDBC Driver - mysql-connector-java-5.1.6-bin.jar
Before using NetBeans 6.5 I use 6.1 and MySQLJDBC Driver -
mysql-connector-java-5.1.5-bin.jar and i worked.
My question is what to do?
--
View this message in context: http://www.nabble.com/com.mysql.jdbc.exceptions.jdbc4.CommunicationsException%3A-Communications-link-failure-tp20616473p20616473.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
View this message in context: http://www.nabble.com/com.mysql.jdbc.exceptions.jdbc4.CommunicationsException%3A-Communications-link-failure-tp20616473p20616473.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.