ITPub博客

首页 > Linux操作系统 > Linux操作系统 > ORA-12505: Using Oracle RAC and Java JDBC thin client Connection

ORA-12505: Using Oracle RAC and Java JDBC thin client Connection

原创 Linux操作系统 作者:sanxiagirl 时间:2012-09-13 10:16:49 0 删除 编辑
If you have Java application and use JDBC to connect to Oracle database, typically you use the following format to connect:

jdbc:oracle:thin:@::
 
However, this would not work if you have Oracle RAC database. Following is the correct JDBC connection string for connecting to a RAC database
    For 11gR1:
    jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=vipaddress_node1)(PORT=1521)) (ADDRESS=(PROTOCOL=TCP)(HOST=vipaddress_node2)(PORT=1521)) (LOAD_BALANCE=no)(FAILOVER=yes))(CONNECT_DATA=(SERVICE_NAME=SID.WORLD)))
         For 11gR2:

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=scan-address)(PORT=1521))(LOAD_BALANCE=YES)(FAILOVER=YES)(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=SID.WORLD)))

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10640532/viewspace-743310/,如需转载,请注明出处,否则将追究法律责任。

下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2008-01-02

  • 博文量
    142
  • 访问量
    496656