Hi,
ich möchte mit meinem Servlet auf eine MySQL Datenbank zugreifen. Dies mache ich wie folgt:
Also Exception bekomme ich nun aber:
Als MySQLConnector habe ich mysql-connector-java-5.1.7-bin. Ich benutze Eclipse.
Woran kann das liegen? Danke
ich möchte mit meinem Servlet auf eine MySQL Datenbank zugreifen. Dies mache ich wie folgt:
Code:
public void doConnect()
{
String host = "localhost";
String database = "testdb";
String port = "3306";
try
{
Class.forName("org.gjt.mm.mysql.Driver");
String url = "jdbc:mysql://"+host+":"+port+"/"+database;
con = DriverManager.getConnection(url, "root", "root" );
}
catch (Exception e)
{
System.out.println("ERRROORRRRR!!!"+e);
}
}
Also Exception bekomme ich nun aber:
Code:
java.sql.SQLException: Communication link failure: Bad handshake
Als MySQLConnector habe ich mysql-connector-java-5.1.7-bin. Ich benutze Eclipse.
Woran kann das liegen? Danke