GeeCON Prague 2014*
The moose likes JDBC and the fly likes Connction faile please help me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connction faile please help me" Watch "Connction faile please help me" New topic
Author

Connction faile please help me

Dorj Galaa
Ranch Hand

Joined: May 29, 2001
Posts: 113
I try connect to My SQL code is
import java.sql.*;
public class MySQL
{
public static void main(String args[])
{
try
{
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
Connection mysql=DriverManager.getConnection("jdbc:mysql://localhost:3306/ok","qqq","qqq");
System.out.println("Ok");
}
catch(ClassNotFoundException e)
{
System.out.println("Class Not Found");
}
catch(SQLException e)
{
System.out.println(e.getMessage());
}
catch(InstantiationException e)
{
System.out.println(e.getMessage());
}
catch(IllegalAccessException e)
{
System.out.println(e.getMessage());
}
}
}
but have bad handshake error


Senior software engineer
 
GeeCON Prague 2014
 
subject: Connction faile please help me