How to write 2 ip for one database?

I have a datasource configuration file where I have contextwith resource(s) like this

<Context>
     <Resource
        name="jdbc/pds"
        auth="Container"
        driverClassName="oracle.jdbc.driver.OracleDriver"
        factory="myPackage.EncryptedDataSourceFactory"
        logAbandoned="true"
        maxTotal="30"
        maxIdle="10"
        maxWaitMillis="1000"
        password="encryptedPassword"
        removeAbandoned="true"
        removeAbandonedTimeout="60"
        type="javax.sql.DataSource"
        url="jdbc:oracle:thin:@myFirstIP:port:MYDB"
        username="username"
        accessToUnderlyingConnectionAllowed="true"
    validationQuery="select 1 from dual" />
</Context>

- ip myFirstIP, validationQuery - , , , ip mySecondIP, , mySecondIP ip ( JAVA ), myFirstIP , mySecondIP. , , myFirstIP, mySecondIP? ? , ?

oracle 11.2.0.2.0, java8 tomcat 8.5 / wildfly 9

+4
1

TNS 2

 url="jdbc:oracle:thin:@(DESCRIPTION=(FAILOVER=ON)(LOAD_BALANCE=off)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.10.10.88)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.10.89)(PORT = 1521)))(CONNECT_DATA=(SERVICE_NAME = D88)(FAILOVER_MODE=(TYPE=select)(METHOD=basic))(SERVER = DEDICATED)))";
+1

Source: https://habr.com/ru/post/1693678/


All Articles