Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

bad handshake error

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