Search code examples
postgresqljdbcquartz-schedulerquartz

Muliptle database connection for JDBC, for Quartz?


I just want to achieve that from my spring application I want to make 2 database connection for master/slave and I am using postgresql

I have 1 datasource and JobStoreX,

org.quartz.dataSource.NAME.URL and the value is jdbc:postgresql://ip1:5432/myQuartzDB

Am I able to do connection with my master and slave like

org.quartz.dataSource.NAME.URL -> jdbc:postgresql://ip1:5432,ip2:5432/myQuartzDB

Is this a correct approach for splitting with "," if it is not, how can I achieve this ?

Thanks !


Solution

  • Yes I was tired and could not be able to research in a good way.

    Documentation: https://jdbc.postgresql.org/documentation/head/connect.html

    It can be applied like this:

    jdbc:postgresql://host1:port1,host2:port2/database