Re: Fail Over / Round Robin

"Mark Matthews" <[email protected]> Sat, 4 Aug 2007 18:22:47 -0500 (CDT)
Newsgroups gmane.comp.db.mysql.java
Message-ID <[email protected]>
>> 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.

  -Mark

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