JDBC connection to Oracle Clustered

后端 未结 2 1576
轻奢々
轻奢々 2021-01-14 03:48

I would like to connect to a clustered Oracle database described by this TNS:

 MYDB=
 (DESCRIPTION = 
    (ADDRESS = (PROTOCOL = TCP)(HOST = host1)(PORT = 41         


        
相关标签:
2条回答
  • 2021-01-14 04:11

    Apparently you can do this

    jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)
    (ADDRESS=(PROTOCOL=TCP)(HOST=host1)
    (PORT=1521))
    (ADDRESS=(PROTOCOL=TCP)(HOST=host2)
    (PORT=1521))
    (CONNECT_DATA=(SERVICE_NAME=service)))
    
    0 讨论(0)
  • 2021-01-14 04:19

    You can use this format, unless you make use of JTA transactions. In that case you must use some different setup. See http://forums.oracle.com/forums/thread.jspa?messageID=2860653&#2860653 (applies for BEA Weblogic, but I think it also applies for other setups and application servers)

    0 讨论(0)
提交回复
热议问题