When using Connector/J with MySQL Fabric, you must provide the
host name and port of the MySQL Fabric server instead of the
database server. The connection string must follow the same form
it normally does, with the addition of the
fabric keyword, as follows:
The user name and password provided to the connection are used for authentication with both the MySQL Fabric server and the individual database servers.
If you are using Java 5, you must manually load the driver class before attempting to connect.
Connection now proceeds normally.
Connection conn = DriverManager.getConnection( "jdbc:mysql:fabric://fabrichost:32274/database", user, password);
To use the Connector/J APIs that support MySQL Fabric, you must
Connection object to the public
interface that provides the necessary methods. The interfaces are:
JDBC3 interface, compatible with Java 5 and later
JDBC4 interface, compatible with Java 6 and later. This
interface must be used to access JDBC4 APIs on the connection.