解決java串連oracle報sid錯誤

來源:互聯網
上載者:User

標籤:ice   name   host   example   資料庫   amp   support   gpo   格式   

上次使用jdbC串連oracle資料庫報了一個關於sid的錯誤.無法串連至sid.解決方案是使用如下格式一方法串連

 

格式一: : 
jdbc:oracle:thin:@//<host>:<port>/<service_name> 
Example: jdbc:oracle:thin:@//192.168.2.1:1521/XE 
注意這裡的格式,@後面有//, 這是與使用SID的主要區別。 
這種格式是Oracle 推薦的格式,因為對於叢集來說,每個節點的SID 是不一樣的,但是SERVICE_NAME 確可以包含所有節點。 

格式二: Oracle JDBC Thin using an SID: 
jdbc:oracle:thin:@<host>:<port>:<SID> 
Example: jdbc:oracle:thin:@192.168.2.1:1521:X01A 
Note: 
Support for SID is being phased out. Oracle recommends that users switch over to usingservice names. 

格式三:Oracle JDBC Thin using a TNSName: 
jdbc:oracle:thin:@<TNSName> 
Example: jdbc:oracle:thin:@GL 
Note: 
Support for TNSNames was added in the driver release 10.2.0.1 

解決java串連oracle報sid錯誤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.