I use java with the Connector/L jdbc driver, I checked the webpage of
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
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.
From: Mattia Merzi [mailto:mattia.merzi@stripped]
Sent: 2010年3月11日 19:01
To: Peter Chen
Subject: Re: How to modify the application to implement the separation of write/read
2010/3/11 Peter Chen <peter.chen@stripped>:
> 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: