jdbc 连接oracle单机与集群配置

  • Post author:
  • Post category:其他


java 代码在连接oracle时,根据oracle安装是单机还是RAC,此时jdbc的连接串或者连接方式有说不通

连接单机的配置:


jdbc.url=jdbc:oracle:thin:@

192.168.1.12:1521:orcl

连接集群的配置:


1.jdbc.url=jdbc:oracle:thin:@

192.168.1.12:1521/orcl


2.jdbc.url=jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 10.204.7.87)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 10.204.7.89)(PORT = 1521))(FAILOVER=ON)(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = tyyj)(FAILOVER_MODE =(TYPE = SELECT)(METHOD = BASIC)(RETRIES = 180)(DEL



版权声明:本文为baby_it原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。