条件:
- jdk 1.6及以上
配置:
jdbc:postgresql://host1:port1,host2:port2/database
连接故障转移:
To support simple connection fail-over it is possible to define multiple endpoints (host and port pairs) in the connection url separated by commas. The driver will try once to connect to each of them in order until the connection succeeds. If none succeeds a normal connection exception is thrown.
为了支持简单的故障转移, 可以配置多个端点(host:port),多个端点之间以逗号隔开。驱动程序将尝试按顺序连接到它们中的每一个,直到连接成功。如果没有成功,则引发正常连接异常。
The simple connection fail-over is useful when running against