Table des matières

JDBC

Tips

MySQL Replication

Starting with Connector/J 3.1.7, we've made available a variant of the driver that will automatically send queries to a read/write master, or a failover or round-robin loadbalanced set of slaves. To enable this functionality, use the “com.mysql.jdbc.ReplicationDriver” class when configuring your application server's connection pool or when creating an instance of a JDBC driver for your standalone application.

Using Master/Slave Replication with ReplicationConnection

You may also want to investigate the Load Balancing JDBC Pool (lbpol) tool, which provides a wrapper around the standard JDBC driver and enables you to use DB connection pools that includes checks for system failures and uneven load distribution: http://code.google.com/p/mysql-lbpool/[mysql-lbpool (Load Balancing JDBC Driver for MySQL).