Bug #72301 Fabric driver swallows exceptions thrown during connection creation using JDBC4
Submitted: 10 Apr 2014 2:00 Modified: 22 Apr 2014 22:02
Reporter: Jess Balint Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:5.1.30 OS:Any
Assigned to: Jess Balint CPU Architecture:Any
Tags: fabric

[10 Apr 2014 2:00] Jess Balint
Description:
The Fabric driver does not properly propagate exceptions thrown when the JDBC4 constructor is called.

java.sql.SQLException: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String                                                                                      
    at com.mysql.fabric.jdbc.FabricMySQLDriver.connect(FabricMySQLDriver.java:78)                                                                                                              
    at java.sql.DriverManager.getConnection(Unknown Source)                                                                                                                                    
    at java.sql.DriverManager.getConnection(Unknown Source)                                                                                                                                    
    at my.HashFabricClientMain2.getConnectionShardTable(HashFabricClientMain2.java:50)                                                                                                         

How to repeat:
Do something that causes an exception to be thrown during connection creation

Suggested fix:
propagate the exception thrown during the constructor as the cause
[22 Apr 2014 22:02] Daniel So
Added the following entry to the Connector/J 5.1.31 changelog:

"The MySQL Fabric driver did not properly propagate exceptions thrown during connection creation using JDBC 4."