jdbc:oracle:thin:@localhost:1521:orcl與jdbc:oracle:thin:@//localhost:1521/orcl區別
阿新 • • 發佈:2019-01-29
Oracle Thin JDBC Driver
驅動程式包名:ojdbc14.jar、ojdbc6.jar
驅動程式類名: oracle.jdbc.driver.OracleDriver
JDBC URL:
1. ServiceName方式:(推薦使用)
jdbc:oracle:thin:@//<host>:<port>/ServiceName
2. SID方式:
jdbc:oracle:thin:@<host>:<port>:<SID>
3.RAC方式(老的寫法,現在一般用ServiceName方式)
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=x.x.x.1)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=x.x.x.2)(PORT=1521)))(LOAD_BALANCE=yes)(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=xxrac)))
4. jdbc:oracle:oci:@service (這種一般沒有人寫吧)
所以這個:
jdbc:oracle:thin:@localhost:1521/orcl