jdbc连接oracle数据库字符串

jdbc连接oracle数据库有两种方式:

  1. 连接数据库SID
  2. 连接数据库service_name

当连接SID时,字符串如下:

url="jdbc:oracle:thin:@192.168.56.100:1521:orcl1" password="xxxx" username"scott" 

当连接SERVICE_NAME时,字符串如下:

url="jdbc:oracle:thin:@//192.168.56.100:1521/orcl" password="xxxx" username"scott" 

 也可以用如下方法

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.100)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=Service-name)))
原文地址:https://www.cnblogs.com/zx3212/p/7194114.html