When the MySQL cluster, the method of use of the JDBC path is used.

xiaoxiao2021-03-06  77

Use this:

JDBC: mysql: // [Host: port], [Host: port] ... / [dataBase] [? PropertyName1] [= PropertyValue1] [= PropertyName2] [= propertyValue2] ...

E.g:

JDBC: MySQL: // Host1: 3306, Host2: 3307, Host3: 3308 / Test? User = root & password = root & automech = true & failoverReadOnly = false

note:

I found a problem when I used, when using the 3.0.14 version of JDBC, use the above method exception:

Java.sql.sqlexception: Server Connection Failure During Transaction.

Attempted reconnect 3 Times. Giving Up.

...

After updating to version 3.0.15, the problem did not appear,

This may be a bug of 3.0.14 this version.

转载请注明原文地址:https://www.9cbs.com/read-93255.html

New Post(0)