jdbc连接oracle数据库有两种方式:
当连接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)))
原文:http://www.cnblogs.com/zx3212/p/7194114.html