At present, PostgreSQL JDBC driver can connect to only one URL. Postgres-XC has multiple coordinators to connect and JDBC driver should be able to select one of them to connect. For load balancing, it is helpful to select a coordinator randomly.
Several extension may be possible. To minimize or eliminate extension impact to other App servers such as JBoss and Tomcat, it will be desirable to maintain URL format. Idea is to use local database URL and expand it to a list of coordinators and their ports, through /etc/multiMaster/localdb file, for example, where "localdb" is the name to specify in database URL in getConnection() method.
Where to extend?
In PostgreSQL JDBC driver, it is implemented in connect() method defined in Driver.java.in file, which is common to all the JDBC driver of different versions.
Writing a code will not be painful. Issues are:
1) Can the path be accepted by JDBC people? The patch will be comon to all multi-master PostgreSQL cluster so there's a chance to include the patch into the original code.
2) Test will need much resource. Test should include parameter value limitation and error handling. How can we divide whole test into smaller pieces?
Load balancing.