• jdbc应用程序连接Oracle rac的URL写法:


    1.应用程序连接Oracle rac的URL写法:

    复制代码
     1 #Oracle(AMS)
     2 jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
     3 jdbc.url=jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.176.199)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.176.198)
     4 (PORT = 1521))(LOAD_BALANCE = yes)(FAILOVER = yes)(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = kobra)(FAILOVER_MODE=(TYPE = SELECT)(METHOD = BASIC)(RET
     5 IRES = 180)(DELAY = 15))))
     6 jdbc.username=kms
     7 jdbc.password=kms
     8 
     9 
    10 #Oracle(Addon-KOBRA)
    11 jdbc1.driverClassName=oracle.jdbc.driver.OracleDriver
    12 jdbc1.url=jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.176.199)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.176.198
    13 )(PORT = 1521))(LOAD_BALANCE = yes)(FAILOVER = yes)(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = kobra)(FAILOVER_MODE=(TYPE = SELECT)(METHOD = BASIC)(RE
    14 TIRES = 180)(DELAY = 15))))
    15 jdbc1.username=bond
    16 jdbc1.password=bond
    复制代码

    备注:如果使用scap ip,可以将以下代码直接替换成scan ip,形式为:jdbc:oracle:thin:@scap ip:1521:kobra

    复制代码
    1 (DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.176.199)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.176.198)
    2 (PORT = 1521))(LOAD_BALANCE = yes)(FAILOVER = yes)(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = kobra)(FAILOVER_MODE=(TYPE = SELECT)(METHOD = BASIC)(RET
    3 IRES = 180)(DELAY = 15))))
    4 (DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.176.199)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.176.198
    5 )(PORT = 1521))(LOAD_BALANCE = yes)(FAILOVER = yes)(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = kobra)(FAILOVER_MODE=(TYPE = SELECT)(METHOD = BASIC)(RE
    6 TIRES = 180)(DELAY = 15))))
    复制代码

    2.客户端tnsnames.ora文件写法如下:

    复制代码
     1 ractest =
     2   (DESCRIPTION =
     3     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.176.199)(PORT = 1521))
     4     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.176.198)(PORT = 1521))
     5     (LOAD_BALANCE= yes)
     6     (FAILOVER= yes)
     7     (CONNECT_DATA =
     8       (SERVER = DEDICATED)
     9       (SERVICE_NAME = kobra)
    10     )
    11   )
    复制代码

    备注:同样,可以将以下ip地址用sacn ip或域名替来替换

    复制代码
     1 ractest =
     2   (DESCRIPTION =
     3   (ADDRESS = (PROTOCOL = TCP)(HOST = scan-ip.localdomain)(PORT = 1521))
     4     (LOAD_BALANCE= yes)
     5     (FAILOVER= yes)
     6     (CONNECT_DATA =
     7       (SERVER = DEDICATED)
     8       (SERVICE_NAME = kobra)
     9     )
    10   )
  • 相关阅读:
    spring mvc controller间跳转 重定向 传参
    SpringMVC拦截器(资源和权限管理)
    Spring3 MVC 拦截器拦截不到的问题
    使用HandlerInterceptor实现简单的授权
    同一个form里,不管哪个 submit 都是直接提交form表单里的内容
    AJax+springMVC+JQURY.GET--注册界面即时刷新用户名是否存在
    Ajax异步检查用户名是否存在(附Demo下载)
    Ajax注册表单用户名实时验证
    SpringMVC记住密码功能(实例)
    CocoaPods停在Analyzing dependencies解决方案
  • 原文地址:https://www.cnblogs.com/xionggeclub/p/5296473.html
Copyright © 2020-2023  润新知