Re: Fail Over / Round Robin

Alan Williamson <[email protected]> Mon, 06 Aug 2007 16:14:50 +0100
Newsgroups gmane.comp.db.mysql.java
Organization Blog-City Ltd
Message-ID <[email protected]>
Thanks Mark, appreciate that.

Mark Matthews wrote:
>>> Fantastic Ronald ... just what i was looking for.
>>>
>> Alan,
>>
>> Connector/J has had simiar functionality built-in for some time now, if
>> you don't want as many "moving" pieces in your setup. Basically, you
>> specify your master, and slaves, and tell C/J when you want to use one or
>> the other by calling Connection.setReadOnly(boolean) "false" for write (or
>> read) to/from the master, and "true" for read-only from one of the slaves.
>>
>> See
>> http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-replication-connection.html
>> for more info.
>>
>>   -Mark
> 
> Alan,
> 
> I just noticed that you're only wanting to read from slaves. In that case,
> you can just use a the "standard" com.mysql.jdbc.Driver for your
> connections, with "roundRobinLoadBalance=true", and each new physical
> connection that is made to the given JDBC URL will use the "next" host in
> the round-robin list.
> 

-- 
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe:    http://lists.mysql.com/[email protected]