aspose file tools*
The moose likes JDBC and the fly likes Bad Handshake Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Bad Handshake" Watch "Bad Handshake" New topic
Author

Bad Handshake

Ronald Whalen
Ranch Hand

Joined: Mar 27, 2001
Posts: 38
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

Joined: Jul 09, 2001
Posts: 1879

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

Joined: Mar 27, 2001
Posts: 38
Thanks. I got it working.
Ronald Whalen
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

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

Joined: Mar 27, 2001
Posts: 38
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

Joined: Jul 09, 2001
Posts: 1879

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Bad Handshake
 
Similar Threads
Bitmechanic connection pool not working ?
JDBC mysql connection error
jdbc connection to ms sql (urgent)
Communication failure during handshake
How do i know , on which port MS Sql Server is running?