• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connction faile please help me

 
Dorj Galaa
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic