如何为postgresql jdbc数据源启用故障切换
我在Liberty application server for postgresql中定义了一个数据源如何为postgresql jdbc数据源启用故障切换,postgresql,jdbc,datasource,websphere-liberty,failover,Postgresql,Jdbc,Datasource,Websphere Liberty,Failover,我在Liberty application server for postgresql中定义了一个数据源 <dataSource jdbcDriverRef="PostgreSQLDriver" ...> <properties password="..." user="admin" serverName="server" portNumber="2020" databaseName="dbname" ssl="false" </dataSource> 是否有
<dataSource jdbcDriverRef="PostgreSQLDriver" ...>
<properties password="..." user="admin" serverName="server" portNumber="2020" databaseName="dbname" ssl="false"
</dataSource>
是否有任何方法可以将此故障切换url提供给应用程序服务器数据源?是的,您可以在元素上指定任何键/值对,Liberty会将其提供给供应商数据源类。在本例中,属性为URL=jdbc:postgresql://host1:port,host2:port,host3:port/dbname 另外,请注意,在Liberty的最新版本中,有一个properties.postgresql,它是特定于Postgres的,并且更好地提供了它的可用设置 举个例子,
<dataSource jdbcDriverRef="PostgreSQLDriver" ...>
<properties.postgresql password="..." user="admin" URL="jdbc:postgresql://host1:port,host2:port,host3:port/dbname" ssl="false"
</dataSource>
是的,您可以在元素上指定任何键/值对,Liberty会将其提供给供应商数据源类。在本例中,属性为URL=jdbc:postgresql://host1:port,host2:port,host3:port/dbname 另外,请注意,在Liberty的最新版本中,有一个properties.postgresql,它是特定于Postgres的,并且更好地提供了它的可用设置 举个例子,
<dataSource jdbcDriverRef="PostgreSQLDriver" ...>
<properties.postgresql password="..." user="admin" URL="jdbc:postgresql://host1:port,host2:port,host3:port/dbname" ssl="false"
</dataSource>
谢谢你的信息。我确实尝试了properties和properties.postgresql,但没有成功。看起来应该行得通。这是正确的解决方案。我使用的驱动程序是一个旧版本,不支持将URL作为数据源属性。谢谢您提供的信息。我确实尝试了properties和properties.postgresql,但没有成功。看起来应该行得通。这是正确的解决方案。我使用的驱动程序是一个旧版本,不支持URL作为数据源属性。