jdbc连接oracle数据库有两种方式:
- 连接数据库SID
- 连接数据库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)))
时间: 2024-10-12 21:14:08