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

 
Ronald Whalen
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am using MySQL as a db with Tomcat 3.2.1. Until a few days ago, I had no problems creating connections to the db. All of a sudden it seems that I get this SQL Exception from the MySQL driver:

java.sql.SQLException: Communication link failure: Bad handshake
at org.gjt.mm.mysql.MysqlIO.init(MysqlIO.java)
at org.gjt.mm.mysql.Connection.<init>(Connection.java)
at org.gjt.mm.mysql.Driver.connect(Driver.java)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:177)

The passwords, url, username are all correct. I have no clue what this could mean, or what is causing it. Any help would be appreciated.

Ronald Whalen
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
from here it says "There was a security bug in the handshake (more precise: in the
password challenge) which was fixed after 3.22.26a.
The JDBC driver had to be fixed, too, because it indirectly relied on
that bug. So just upgrade your JDBC driver, too."
I also read a few things that say an unsigned applet might throw this exception or a connection timeout, but nothing concrete to support this.
Jamie
 
Ronald Whalen
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. I got it working.
Ronald Whalen
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ronald Whalen:
Thanks. I got it working.
Ronald Whalen

What was the cause/solution? This will help other people with the same problem when they read this thread.
Jamie
 
Ronald Whalen
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I downloaded the newest version of the MM MySQL driver (2.14 I believe) and started using it. I collected all other MySQL drivers on my machine and deleted them.

This is a separate but related question:
Is it possible to somehow get the DriverManager or another class identify the exact path of the driver it is actually using?
Thanks
Ronald Whalen
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ronald Whalen:
I downloaded the newest version of the MM MySQL driver (2.14 I believe) and started using it. I collected all other MySQL drivers on my machine and deleted them.

This is a separate but related question:
Is it possible to somehow get the DriverManager or another class identify the exact path of the driver it is actually using?
Thanks
Ronald Whalen

Sorry for the delayed reply, I missed your response. What your looking for is found in the DatabaseMetaData interface. Some methods that might interest you are getURL(), getDriverMajorVersion(), getDriverMinorVersion() getDriverName(), getDriverVersion(). Combined they might help you identify the driver.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic