-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Closed
Labels
for: stackoverflowA question that's better suited to stackoverflow.comA question that's better suited to stackoverflow.com
Description
Question
Is there a solution that is configured in the application.properties file?
DB2 HADR using clientRerouteAlternateServerName, clientRerouteAlternatePortNumber, enableClientAffinitiesList
to indicate alternate server info.
I tried use below code to config datasource.
@Bean
public DataSource initds(){
Properties p = new Properties();
p.setProperty("user", "user");
p.setProperty("password", "password");
p.setProperty("clientRerouteAlternateServerName", "172.30.1.60,172.30.1.61");
p.setProperty("clientRerouteAlternatePortNumber", "53000,53000");
p.setProperty("enableClientAffinitiesList", "1");
DriverManagerDataSource dmds = new DriverManagerDataSource();
dmds.setDriverClassName("com.ibm.db2.jcc.DB2Driver");
dmds.setConnectionProperties(p);
dmds.setUrl("jdbc:db2://172.30.1.60:53000/dbsam");
return dmds;
}
Metadata
Metadata
Assignees
Labels
for: stackoverflowA question that's better suited to stackoverflow.comA question that's better suited to stackoverflow.com