Hi Mattia, I use java with the Connector/L jdbc driver, I checked the webpage of http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-replication-connection.html, it suggests to use "ReplicationDriver" to replace common driver.
I use Hibernate to access Mysql, the connection poll is c3p0-0.9.0, can I just need to modify the configuration of JDBC URL, like "jdbc:mysql:replication://master,slave1,slave2,slave3/test" to implement the separation of write/read? After configuring JDBC URL like this, can I make the query SQL requests to access the Slave server, the update/insert/delete SQL requests to access the Master server, and if the Master server is shotdown, the driver will failover to the Slave server? I am not sure whether do I need to modify something else? Like my application code. Expect your reply. Thanks, Peter -----Original Message----- From: Mattia Merzi [mailto:mattia.me...@gmail.com] Sent: 2010年3月11日 19:01 To: Peter Chen Cc: mysql@lists.mysql.com Subject: Re: How to modify the application to implement the separation of write/read 2010/3/11 Peter Chen <peter.c...@aicent.com>: [...] > Does someone have met this problem? How to implement the separation of > read and write? please, write us some more details about your application! For example, if you use java with the Connector/j jdbc driver, you can enjoy a really nice feature already implemented in the driver: http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-replication-connection.html Greetings, Mattia. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=arch...@jab.org