Bug #3923 Connection URL throws java.sql.SQLException on connect()
Submitted: 28 May 2004 7:28 Modified: 28 May 2004 14:33
Reporter: Gerry Matte Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S1 (Critical)
Version:3.013 Production Stable OS:
Assigned to: CPU Architecture:Any

[28 May 2004 7:28] Gerry Matte
Description:
This version of Connector J (3.0.13) released May 27 2004 does not accept a database URL that contains a hostname. Eg jdbc:mysql://127.0.0.1/database 
The error thrown is:
SQLException: java.sql.SQLException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "127.0.0.1"'.

The same exception is thrown for hostname localhost when used instead of the IP address. Eg jdbc:mysql://localhost/database 

If the database URL completely omits a hostname, the connection succeeds. Eg jdbc:mysql:///database 

This error was tested using Borland JBuilder's Database Pilot and previously functional version of the driver (Version 3.0.11) - when the Driver was replaced with version 3.0.13 the SQLException was thrown.

Gerry Matte
IT Manager, Municipality of Saanich
Victoria, BC
Canada
matteg@gov.saanich.bc.ca

How to repeat:
The testsuite should have caught this error.
Any functional java program should now fail if the connection URL contains a host name.
[28 May 2004 14:33] Mark Matthews
Thank you for your bug report. This issue has already been fixed
in the latest released version of that product, which you can download at 
http://www.mysql.com/downloads/
[28 May 2004 14:35] Mark Matthews
The reason the testsuite _did_ not catch this particular bug is because of the number of servers we run it against...They're all on non-standard ports. URL's with port #'s in them worked fine with this release.

This has now been rectified in our testing setup (one server runs on a default port, and the URL does not specify a port).